Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Chart Controls/Dundas Charts Clear Contents?

I am using the Dundas Chart Controls and Microsoft Chart Controls for .NET. Currently I have a method which populates the chart control with a date from a generic List.

Let's say that I populate the chart with data from one list. Then I want to populate the chart with data from another list.

I have a problem populating the chart with the data from the second list. I end up with a chart that displays the combined data from list 1 and list 2, whereas I want it to display only the data from the first list, and then clear the chart before displaying the data from the second list.

I have tried various method calls to clear the chart control before populating it with the data from the second list but to no avail.

Is there a way of doing this?

like image 900
Goober Avatar asked Oct 19 '25 23:10

Goober


1 Answers

I found it! Do this:

chart1.Series[0].Points.Clear();
like image 54
Goober Avatar answered Oct 21 '25 16:10

Goober