Clear ZedGraph Data
I am using ZedGraph on a windows form to display bar chart. Following code executes when user click on a button.
zg1.GraphPane.AddBar("Series", 开发者_Python百科null, y, Color.Red);
It adds an extra bar every time user click on button. I am looking for a way to reset or clear data already in chart.
How can i do that????
zg1.GraphPane.CurveList.Clear();
zg1.GraphPane.GraphObjList.Clear();
don't forget to give zg1.Refresh() if never see the result if you don't refresh.
No Need to clear anything, the think you need to put at the end of the code after generating the graph is zg1.Refresh()
精彩评论