Lock axis in ZedGraph

只谈情不闲聊 提交于 2019-12-23 13:32:04

问题


I've used ZedGraph to plot data from several sources with a single click. I need the Y-axes to always have the same max and min-values for each plot. I need this to be able to see changes between datasets as I flip through them. In my case, it would not make sense to plot data from several sources in one graph.

I've tried to set axis properties like this:

    myPane.Y2Axis.Scale.Max = 40;
    myPane.Y2Axis.Scale.MaxAuto = false;
    myPane.Y2Axis.Scale.Min = -40;
    myPane.Y2Axis.Scale.MinAuto = false;

I still see the axes beeing auto scaled. Please give me a hint if this is possible or not. I probably only miss a small thing...

(by the way: I hope someone picks this project up, it's great!)


回答1:


Well, solved like this:

        zGC.AxisChange();
        zGC.RestoreScale(myPane);
        zGC.ZoomOut(myPane);

Added a ZoomOut(), since I realized that RestoreScale() actually always autozooms...

-rb




回答2:


Is your intention to synchronize the scales of all panes that you use? If so, have you seen this tutorial?

The second thing is that the Y2Axis is not visible by default. ZG uses by default first Y axis (YAxis). Have you enabled Y2Axis manually?



来源:https://stackoverflow.com/questions/2681414/lock-axis-in-zedgraph

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!