Wrong chart category axis labels

I am parsing this XSLS document testExcel.xlsx.
And chart has dates as category axis with minimum/maximum bounds added.

But when exporting to image dates are different than in excel. Attached image example.png.

I can see that data in chart object itself is correct:

but when running chart.calculate() these dates are calculated incorrectly chart.getCategoryAxis().getAxisLabels()

So it seems a calculation problem and not image export.

It seems that there is a bug in the code, because maximum month day is always set with minimum max month date that existed before, for example if february has max 28 days, upcoming months even if they had more days will be written as with 28 days.

And this is different from is in excel.

Attached data:
example.zip (102.5 KB)

Did not attach excel file itself, reattaching.example2.zip (113.5 KB)


Please notice, I am able to reproduce the issue as you mentioned by using your template file. I converted the chart in the template file to image format (PNG) and found category axis labels in the chart image are not the same as in the original Excel chart.
Sample code:

Workbook workbook = new Workbook("f:\\files\\testExcel.xlsx");
Chart chart = workbook.getWorksheets().get(0).getCharts().get(0);


I have logged a ticket with an id “CELLSJAVA-44314” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.


This is to inform you that your issue has been resolved. The fix will be included in our upcoming release, i.e., Aspose.Cells for Java v22.2. You will also be informed once the next version is published.

1 Like

Thank you! As far as I understand Java version will come soon after?


Yes, you may expect the new JAVA version in couple of days.

The issues you have found earlier (filed as CELLSJAVA-44314) have been fixed in this update. This message was posted using Bugs notification tool by johnson.shi

Please try the lastest version 22.2, we have made some improvement in aspose.cells-for-java-22.2.
We will fix the issue “the maximum month day” in the next version 22.3.

Pelase see the output image generated by V22.2output.png (37.2 KB)

Thank you. So I will wait for 22.3 version as maximum date is not fixed yet with 22.2


Sure, and the next version is scheduled to be published before the end of second week of March, 2022.


I am glad to inform you that your issue has been resolved.
I have atteched the output image from my test case for your reference.output.png (5.6 KB)

The issues you have found earlier (filed as CELLSJAVA-44314) have been fixed in this update .