Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 235
Manjoor Avatar asked Jun 14 '11 14:06

Manjoor


2 Answers

zg1.GraphPane.CurveList.Clear();
zg1.GraphPane.GraphObjList.Clear();
like image 66
Patrick Avatar answered Oct 06 '22 01:10

Patrick


don't forget to give zg1.Refresh() if never see the result if you don't refresh.

like image 28
santo Avatar answered Oct 06 '22 00:10

santo