I hope someone might be able to help with another question re MS Chart.
I have added five series dynamically to my chart, using the following procedure in a for loop:
private void addSeries(string nme, Color clr)
Chart1.Series[nme].Name = nme;
Chart1.Series[nme].ChartType = SeriesChartType.Line;
Chart1.Series[nme].BorderWidth = 2;
Chart1.Series[nme].MarkerStyle = MarkerStyle.Circle;
Chart1.Series[nme].XValueMember = "theDate";
Chart1.Series[nme].YValueMembers = nme;
Chart1.Series[nme].Legend = "Legend1";
Chart1.Series[nme].Color = clr;
Now, I want to be able to enable/disable each series via a button click, but when I try I'm getting an error message to the effect that the series (never gets past the first one in the loop) cannot be found in the SeriesCollection: "A chart element with the name MD could not be found in the SeriesCollection". I thought that calling the Add method of the Series object would add the named Series to the SeriesCollection. How, can I ensure that dynamically created series are added to the collection?