Search code examples
c#chartszedgraph

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


Solution

  • zg1.GraphPane.CurveList.Clear();
    zg1.GraphPane.GraphObjList.Clear();