简体   繁体   中英

C#:ZedGraph Zooming all panes simultaneously

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);
    }

You can achieve this by using .IsSynchronizeXAxes and z.IsSynchronizeYAxes property of the ZedGraph control:

zgc.IsSynchronizeXAxes = true;
zgc.IsSynchronizeYAxes = true;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM