Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用c更改Y轴最小/最大比例值#_C#_Excel_Charts - Fatal编程技术网

C# 如何使用c更改Y轴最小/最大比例值#

C# 如何使用c更改Y轴最小/最大比例值#,c#,excel,charts,C#,Excel,Charts,我正在尝试使用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; 任何帮助或建议都将不胜感激。谢谢 使用XlAxisType.xlValue 以下是我

我正在尝试使用
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;

任何帮助或建议都将不胜感激。谢谢

使用
XlAxisType.xlValue

以下是我使用的代码:

myChart.Axes(XlAxisType.xlValue).MinimumScale = MIN_SCALE;

可能是不同的图表类型将/不适用于此。

感谢您的快速响应,刚刚尝试了bit&我收到以下错误:
错误HRESULT E_FAIL已从对COM组件的调用返回。
。抱歉,我的错误我忘了将
XlAxisGroup.xlSecondary
更改回
XlAxisGroup.xlPrimary
。像宝石一样工作,非常感谢……:)对我来说很有用。你能告诉我如何改变横轴的值吗??因为现在它只是1,2,3,4,5。。。。等等