【问题标题】:How to scalling Secondary axis (AxisY2) in Line chart of MS Chart?如何在 MS Chart 的折线图中缩放辅助轴(Axis2)?
【发布时间】:2012-11-29 07:03:34
【问题描述】:

我想在我的图表上应用比例视图选项。我编写了以下代码,允许我在 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 上缩放。任何人都可以知道我必须在我的代码中更改或添加什么。

【问题讨论】:

    标签: c# winforms mschart


    【解决方案1】:

    我已经根据下面的代码自己解决了这个问题。

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-10-29
      • 2022-07-07
      • 2019-05-24
      • 1970-01-01
      • 2019-09-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多