Profile Picture

legends disappear after removing the first one

Posted By Daniel Csimszi 11 Years Ago
Author
Message
Daniel Csimszi
questionmark Posted 11 Years Ago
View Quick Profile
Forum Guru

Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)Forum Guru (50 reputation)

Group: Forum Members
Last Active: 8 Years Ago
Posts: 61, Visits: 35
Hi,

I have an interactive graph where the users can add/remove charts. The problem of mine is whenever I remove the first added graph with its graph legend then all of the graph legends disappear and they do not reappear if I add more graphs.

This is my code:

//find the right line
int index = findChartIndex(name);

NLineSeries m_Line = lineList[index];
NCartesianChart m_Chart = (NCartesianChart)nChartControl1.Charts[0];
//remove line from the chart
m_Chart.Series.Remove(m_Line);

//remove line from the line list
lineList.RemoveAt(index);

//remove legend
if (nChartControl1.Legends.Count > index)
nChartControl1.Legends.RemoveAt(index);

nChartControl1.Refresh();

Do you have any idea whey it removes all of the legends, it seems like it "Clear()"s the legends.

Regards
Daniel




Similar Topics


Reading This Topic