Hi,
When calculating and trying to get maximum and minimum y axis value of charts in C# code, I found the result returned by Aspose.Cells is inconsistent to what was actually in the MS Excel chart.
Sample Code Get Maximum and Minimum Y Axis Value of Charts in C#
var workbook1 = new Workbook(@".\test.xlsx");
var chart1 = workbook1.Worksheets[0].Charts[0];
chart1.Calculate();
Console.WriteLine(chart1.ValueAxis.MaxValue); // write 38, should be 40
Console.WriteLine(chart1.ValueAxis.MinValue); // write 28, should be 20
var workbook2 = new Workbook(@".\test2.xlsx");
var chart2 = workbook2.Worksheets[0].Charts[0];
chart2.Calculate();
Console.WriteLine(chart2.ValueAxis.MaxValue); // write 140, should be 150
Console.WriteLine(chart2.ValueAxis.MinValue); // correct as 100
I’ve attached two test examples for your reference. Could you please take a look?
test.zip (59.8 KB)
Thanks,