简体   繁体   English

如何使用c#从Excel图表中读取(获取)Y轴比例值(最小值和最大值)

[英]How to read(get) the Y-Axis Scale Values(Min&Max) from Excel Chart using c#

Is there any way to get the Y-Axis Min & Max values from the Excel Chart using C# , I've the following chart which is drawn using set of values in C#, and exported into .xls file. 有什么方法可以使用C#Excel Chart获取Y轴的 Min & Max ,下面的图表是使用C#中的一组值绘制的,并导出到.xls文件中。

在此处输入图片说明

Now I want to read the Y-Axis Scale Min & Max values in C# 现在,我想在C#读取Y-Axis Scale Min & Max

EDIT:

在此处输入图片说明

any help on this would be much appreciated, Thanks.! 任何帮助,将不胜感激,谢谢!

You can use: 您可以使用:

Excel.ChartObject myChart = (Excel.ChartObject)xlCharts.Add(1,1,100,100);
chartPage = myChart.Chart;
Excel.Axis yAxis = (Excel.Axis)chartPage.Axes(Excel.XlAxisType.xlValue);
yAxis.MinimumScale = 0.0;
yAxis.MaximumScale = 30;
yAxis.MajorUnit = 5;
yAxis.MinorUnit = 1;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM