2

How can I clear the chart of zedGraph?
z1.GraphPane.CurveList.Clear(); command only clear the curve alone. I want to clear entire graph and replace with new chart line.

Ron Beyer
  • 11,003
  • 1
  • 19
  • 37
niksan karkee
  • 157
  • 1
  • 17

1 Answers1

3

You might have gotten the answer by now, but for others who are interested in this topic, here is what I do in my own code, I have a clear method that has the following calls that clear my chart,

  z1.GraphPane.CurveList.Clear();
  z1.GraphPane.GraphObjList.Clear();
  z1.GraphPane.Title.Text = "";
  z1.GraphPane.XAxis.Title = "";
  z1.GraphPane.YAxis.Title = "";
  z1.GraphPane.Y2Axis.Title = "";
  z1.GraphPane.XAxis.Type = AxisType.Linear;
  z1.GraphPane.XAxis.Scale.TextLabels = null;
  z1.RestoreScale(z1.GraphPane);
  z1.AxisChange();
  z1.Invalidate();
faljbour
  • 1,367
  • 2
  • 8
  • 15