Reputation: 955
I am using zedgraph to plot my data. I have a MasterPane
and it has three GraphPanes
. After drawing data I want to zoom all graphs simultaneously. Any suggestion?
MasterPane master = zgc.MasterPane;
master.Title.IsVisible = true;
master.Margin.All = 10;
master.Fill = new Fill(Color.WhiteSmoke, Color.FromArgb(220, 220, 255), 45.0f);
master.PaneList.Clear();
for (int i = 0; i < numberOfPanes; i++)
{
string title = null;
GraphPane pane = new GraphPane();
master.Add(pane);
if (i == 0)
title = "";
if (i == 1)
title = "";
if (i == 2)
title = "";
if (i >= 3)
title = "" + (i - 2).ToString();
GraphSettings.PanelProperties(pane, title);
}
zgc.AxisChange();
using (Graphics g = frm.CreateGraphics())
{
master.SetLayout(g, PaneLayout.SquareColPreferred);
master.SetLayout(g, PaneLayout.SingleColumn);
master.AxisChange(g);
}
Upvotes: 1
Views: 656
Reputation: 18031
You can achieve this by using .IsSynchronizeXAxes
and z.IsSynchronizeYAxes
property of the ZedGraph control:
zgc.IsSynchronizeXAxes = true;
zgc.IsSynchronizeYAxes = true;
Upvotes: 1