Clear ZedGraph Data

Manjoor picture Manjoor · Jun 14, 2011 · Viewed 11.8k times · Source

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", 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????

Answer

Patrick picture Patrick · Jun 15, 2011
zg1.GraphPane.CurveList.Clear();
zg1.GraphPane.GraphObjList.Clear();