2012-11-29 27 views
3

我想在我的图表上应用比例视图选项。我写了下面的代码,它允许我在AxisY上缩放视图。但不在AxisY2上。如何缩小MS Chart折线图中的次轴(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上缩放。任何人都可以知道我需要更改或添加的代码。

回答

2

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

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