We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Legends missing in Chart's PDF


I am using Aspose.Cells v17.5 to generate PDF of chart - “Chart 1” in the attached excel file. In the PDF output, legends are missing. Same issue also occurs in PNG output.

Following code is used to generate the PDF:

Workbook workbook = new Workbook(“test.xlsx”);
WorksheetCollection ws = workbook.getWorksheets();
String worksheetName = “Sheet1”;
Chart chart = ws.get(worksheetName).getCharts().get(“Chart 1”);
chart.toPdf(“D:\aspose generated.pdf”);

Can you please look into this issue.



Thanks for providing us template file, screenshot and sample code.

After an initial test, I am able to observe the issue as you mentioned (via your screenshot) by using your sample code with your template file. I found that legend item missing in Chart’s PDF. I have logged a ticket with an id “CELLSJAVA-42300” for your issue. We will look into it soon.

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

Thank you.


These types of issues are hard to be fixed. Please check the attached picture. We find it is not same when opening into Excel 2010 and Excel 2016. In 2016, the legend is missing too.

Thank you.


Please try our latest version aspose.cells-for-java-21.6.
If you find any issue, please provide the source Excel file to help us analyze it.