I am trying to create a visual representation of my data, I have already populated point pair lists and I am creating my chart as follows:
public void CreateChart(ZedGraphControl zgc)
{
GraphPane myPane = zgc.GraphPane;
//set the title and axis labels
myPane.Title.Text = "Graph";
myPane.XAxis.Title.Text = "Width";
myPane.YAxis.Title.Text = "Height";
//create curves
BarItem myCurve = myPane.AddBar("1", pointPairList1, Color.Blue);
BarItem myCurve2 = myPane.AddBar("2", pointPairList2, Color.Red);
zgc.AxisChange();
}
When I call the method CreateChart(chart1) no changes are made to the graph, even the titles dont get updated.. Can anyone spot my mistake?
ANSWER:
chart1.AxisChange();
chart1.Invalidate();
chart1.Refresh();