如何在MS Chart的折线图中缩放次要轴(AxisY2)?

3

我想在我的图表上应用比例视图选项。我已经编写了以下代码,它允许我在AxisY上缩放视图。但是在AxisY2上无法实现。

chart1.ChartAreas["Area"].CursorY.IsUserEnabled = true;
chart1.ChartAreas["Area"].CursorY.IsUserSelectionEnabled = true;
chart1.ChartAreas["Area"].AxisY.ScaleView.Zoomable = true;
chart1.ChartAreas["Area"].AxisY2.ScaleView.Zoomable = true;

我可以在AxisY上进行缩放,但无法在AxisY2上进行缩放。是否有人知道我需要在代码中更改或添加什么。

1个回答

2

我通过自己的努力按照下面的代码解决了这个问题。

chart1.ChartAreas["Area"].AxisY2.ScaleView.Zoomable = true;
chart1.ChartAreas["Area"].AxisY2.ScaleView.Zoom(ScaleMinValue, ScaleMaxValue);

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接