I'm trying to change the Y Axis Scale limits of Excel Chart
using C#
, the following code works fine on X-axis
but struggling to change this to Y-axis.
我正在尝试使用C#更改Excel图表的Y轴刻度限制,以下代码在X轴上工作正常,但很难将其更改为Y轴。
Excel.Axis ax = chartPage_1.Axes(Excel.XlAxisType.xlCategory, Microsoft.Office.Interop.Excel.XlAxisGroup.xlPrimary) as Excel.Axis;
ax.MinimumScale = 0.3;
any help or suggestions would be much appreciated. Thanks.!
任何帮助或建议将不胜感激。谢谢。!
1 个解决方案
#1
3
Instead of XlAxisType.xlCategory
, use XlAxisType.xlValue
使用XlAxisType.xlValue代替XlAxisType.xlCategory
Here's the code I'm using:
这是我正在使用的代码:
myChart.Axes(XlAxisType.xlValue).MinimumScale = MIN_SCALE;
Could be that different chart types will/won't work with this.
可能是不同的图表类型将/不适用于此。
#1
3
Instead of XlAxisType.xlCategory
, use XlAxisType.xlValue
使用XlAxisType.xlValue代替XlAxisType.xlCategory
Here's the code I'm using:
这是我正在使用的代码:
myChart.Axes(XlAxisType.xlValue).MinimumScale = MIN_SCALE;
Could be that different chart types will/won't work with this.
可能是不同的图表类型将/不适用于此。