Chart area is rendered incorrectly in PDF and PNG outputs of Excel Chart

Hello,

I am using Aspose.Cells v17.8.7 to generate PDF and PNG of chart - “Chart” in the attached excel file. The output is not same as the actual chart. The chart area, labels, legends, everything is rendered incorrectly.

Following code is used to generate the output:

Workbook workbook = new Workbook(“test.xlsx”);
WorksheetCollection ws = workbook.getWorksheets();
String worksheetName = “Sheet”;
Chart chart = ws.get(worksheetName).getCharts().get(“Chart”);
chart.toPdf(“aspose response 17.8.7.pdf”);

PFA below the source excel and pdf and png outputs:
attachments.zip (211.2 KB)

Can you please analyse this issue.

Thanks,
Neha

@Neha_Gautam,

Thanks for the template file, screenshot and output files.

After an initial test, I observed the issue as you mentioned by using your sample code with your template file. I found chart area, labels, etc. is not rendered correctly in the output PDF and PNG.
e.g
Sample code:

Workbook workbook = new Workbook(“test.xlsx”);
WorksheetCollection ws = workbook.getWorksheets();
String worksheetName = “Sheet”;
Chart chart = ws.get(worksheetName).getCharts().get(“Chart”);
chart.toPdf(“aspose response 17.8.7.pdf”);

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

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

Hello,

Thanks for your reply.

This issue is faced by our customer in their Production Environment, so it is very critical for us. Can you kindly look into this issue on priority and provide a fix for this ASAP. Also, can you please provide a tentative date for when we can expect a fix for this.

Thanks,
Neha

@Neha_Gautam,

I have logged your concerns against your issue “CELLSJAVA-42410” into our database and asked the concerned developer from product team to update on it or share an ETA (if possible).

Once we have any new information, we will share it with you.

@Neha_Gautam,

Please try our latest fix/version: Aspose.Cells for Java v17.9.2:

Your issue “CELLSJAVA-42410” should be fixed in it.

Let us know your feedback.

Hello,

I tested this issue with Aspose.Cells v17.9.2. The rendering of chart area has been fixed but the chart labels and legends are still not rendered correctly.

PFA the pdf and png outputs along with a screenshot of the issue:
aspose response_17.9.2.pdf (26.1 KB)
aspose response_17.9.2.png (80.8 KB)
comparison.png (42.2 KB)

Can you please look into this.

Thanks,
Neha

@Neha_Gautam,

Thanks for the sample files and screenshot.

I noticed the issue with chart labels of both vertical axis. I have reopened your issue now. Regarding legend items and their placements, I am afraid, MS Excel itself displays the legend differently when opening the file into MS Excel 2007, 2010/2013, etc. Even MS Excel 2013 does not show both legend items (it shows only one). So, I am afraid, we might not fix it as we will work to render legend items as per MS Excel 2007 for now (MS Excel 2007 shows both legend items fine).

@Neha_Gautam,

Our concerned developer from product team has evaluated your issue further. I’m afraid the labels of value axis issues can not be fixed soon. Now we can not figure out major unit exactly the same as Excel when it is automatic. If you enlarge the chart(drag right-bottom corner), you will find the labels will be shown.

The issues you have found earlier (filed as CELLSJAVA-42410) have been fixed in Aspose.Cells for Java 17.10.

The issues you have found earlier (filed as CELLSJAVA-42410) have been fixed in Aspose.Cells for Java 24.3.