It may be obvious but I missing it.... How do I reset the chart so that I can use new data for the same control. I have tried the disposed method without luck. Any help would be appreciated.
I'm assuming you are talking about the System.Windows.Forms.DataVisualization.Charting.Chart control?, and that you are setting the data by using the DataSource property? If i'm not mistaken, can't you just change the datasource and then call the DataBind method to use a different set of data?
Example:
Chart1.DataSource = myDataView
Chart1.DataBind()
I'm not too familiar with this control, but if your trying to clear everything you can use the Clear methods of the Series and Chart Areas, and maybe also set the DataSource to nothing?
I am using system.windows.forms.datavisualization.charting. But I'm not using data binding. I populate several series on a given chart from several sources. All I want to do is change some of the initial conditions and see what the graph will look like.
I'm still looking for a better way - in the mean time I found that I can clear the the series and then rebuild the entire chart. Not pretty but it works
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.