Wednesday, 4 September 2013

ZedGraph: Won't work under button click event

ZedGraph: Won't work under button click event

I a windows forms project in VS2012 with a ZedGraph Control and a button.
I have the following code:
double[] testing = { 0, 1, 2, 3, 4, 5 };
LineItem myline = zedGraphControl1.GraphPane.AddCurve("testing", testing,
testing, Color.Red);
zedGraphControl1.AxisChange();
When I have it under the Form_load event, the line chart is generated like
it should be. However if I move the code under the button click event,
nothing happens. I just have a blank graph.
I've made sure the event is firing and when I look under the
GraphPane.CurveList there is a curve with the expected values.
Can anyone suggest a reason why this might be happening?

No comments:

Post a Comment