I want to add a ZedGraph when I click a button, but the ZedGraph is not coming up when I click my button. Here is my button click handler:
ZedGraphControl zg1 = new ZedGraphControl();
zg1.Dock = DockStyle.Fill;
GraphPane myPane = new GraphPane();
BarItem myBar = new BarItem("Bar1");
myBar.AddPoint(1, 10);
myBar.AddPoint(2, 20);
myBar.Bar.Fill = new Fill(Color.AliceBlue, Color.White, Color.AliceBlue);
zg1.AxisChange();
zg1.Invalidate();
zg1.Show();
The main thing that jumps out at me is that I don’t see you adding your new
Controlto your Container Object wether it be aFormor aPanel. Also you are not associating yourPaneor yourBarto yourZedGraphControlTry Something like this