在 ZedGraph 中的所有图中重新缩放 X
我可以使用以下代码成功地仅在所有绘图中缩放 x 轴:
zg1.IsEnableHZoom = true;
zg1.IsEnableVZoom = false;
zg1.IsSynchronizeXAxes = true;
foreach (GraphPane gp in zg1.MasterPane.paneList)
{
> //What code can I put here?
}
我的问题是,使用此代码,Y 轴根据数据的原始视图保持在最大值和最小值。我希望 Y 轴自动缩放,以便最大值和最小值仅基于由于 x 轴缩放而可见的数据(当然,每个图形窗格)。是否有一些命令或强力方法可以在上面显示的 for 循环中的每个图形窗格上使用?提前感谢任何人的帮助。
I can successfully zoom x-only across all plots using the following code:
zg1.IsEnableHZoom = true;
zg1.IsEnableVZoom = false;
zg1.IsSynchronizeXAxes = true;
foreach (GraphPane gp in zg1.MasterPane.paneList)
{
> //What code can I put here?
}
My problem is that using this code, the Y-axis remains at a max and min based on the original view of the data. I want the Y-axis to autoscale so that the max and min is ONLY based on the data visible due to the x-axis zoom (per graph pane, of course). Is there some command, or brute force method, that I can use on each of the graph panes in the for loop shown above? Thanks ahead of time for anyone's help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在循环中使用它(假设 X 轴缩放 MinAuto 和 MaxAuto 为 false)
You can use this in the loop (assuming X Axis scale MinAuto and MaxAuto are false)
我以前也遇到过同样的问题,除了检查所有曲线点之外找不到其他方法。
我向 Paint 事件添加了一个事件处理程序来执行此操作,我确信有一些方法可以对此进行优化。
像这样的东西:
I had the same problem before and could not find a way other than to inspect all the curve points.
I added an event handler to the Paint event to do this, I'm sure there are ways this can be optimized.
Something like this: