.net chart clear and re-add
asp.net, c#, charts
Solution
This should work:
foreach(var series in chart.Series) {
series.Points.Clear();
}
Problem
I have a chart and I need to clear it in order to populate it with different values. The chart has 3 series, all defined in the .aspx page. The problem is when I call ``` chart.Series.Clear(); ``` and then re-add the series like: ``` chart.Series.Add("SeriesName"); ``` It doesn't keep any of the attributes of the 3 initial series. How to just clear the values and keep the series attributes?