How to get the Y axis Maximum values

Dear @mudassir.fayyaz,

Good Day.

I am trying to get the Y axis max value from the chart. But not able to get the maximum value of Y axis.
Herewith attached the code and sample excel for your reference.

I am using Java ----> aspose.cell.18.7 jar file.

Regards
Prabu R Max_value.zip (83.4 KB)

@prabu759101,

You can get maximum value of Y axis with chart.getValueAxis().getMaxValue() but null is returned instead of the value “1200”. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSJAVA-42760 - Maximum value of value axis is returned null

@prabu759101,

Thanks for the template file, sample code and screenshot.

Please try the following sample code to get the maximum value on y-axis:
e.g
Sample code:

Workbook workbook = new Workbook("f:\\files\\Max_value\\StackedColChart.xlsx"); 
        Worksheet csheet = workbook.getWorksheets().get(0); 
        Chart chart = csheet.getCharts().get(0); 
        chart.calculate();
        System.out.println(chart.getValueAxis().getMaxValue());
        .........

Hope, this helps a bit.

Dear @Amjad_Sahi,

Thanks for your quick reply.
Its working fine. Thanks a lot.

Regards
Prabu R

@prabu759101,

Good to know that your issue is sorted out by the suggested code. Feel free to contact any time if you need further help or have some other issue or queries, we will be happy to assist you soon.