I have several ZedGraphControls on my form, when I go to reuse them with new data, I do the following:
myZed.GraphPane.CurveList.Clear(); myZed.GraphPane.GraphItemList.Clear();
but I find that the Axis value (YAxis.Min, etc.) retain their values from the previous use. Is there a function to completely "reset" the control?
Try this:
myZed.GraphPane = new GraphPane( myZed.GraphPane.PaneRect, "New Title", "New X Axis", "New Y Axis" ); myZed.Refresh();
This just completely replaces the GraphPane, only keeping the original paneRect. John
Log in to post a comment.
I have several ZedGraphControls on my form, when I go to reuse them with new data, I do the following:
myZed.GraphPane.CurveList.Clear();
myZed.GraphPane.GraphItemList.Clear();
but I find that the Axis value (YAxis.Min, etc.) retain their values from the previous use. Is there a function to completely "reset" the control?
Try this:
myZed.GraphPane = new GraphPane(
myZed.GraphPane.PaneRect,
"New Title", "New X Axis", "New Y Axis" );
myZed.Refresh();
This just completely replaces the GraphPane, only keeping the original paneRect.
John