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

Free Support Forum - aspose.com

Chart to PDF problem

Hi,


I am using Aspose cells 8.5.2.4

In PDF of Chart 1, data label text is getting hidden behind the chart header just like in chart
1(middle east and Africa text)

Following is the code snippet being used to generate PDF files:
Workbook workbook = new Workbook(“C:/temp/ChartIssue.xlsx”);

WorksheetCollection ws = workbook.getWorksheets();
Worksheet sheet1 = ws.get(“wo cons charts”);
Chart chart = sheet1.getCharts().get(“Chart 1”);
ChartShape cshape = chart.getChartObject();
int sheetIndex = ws.add();
Worksheet worksheet = ws.get(sheetIndex);

//Setting the name of the newly added worksheet
String transientSheetName = “TransientWorksheet”;
worksheet.setName(transientSheetName);

//Copy the Chart to Second Worksheet
worksheet.getShapes().addCopy(cshape, 0, 0, 0, 0);

//Get the new chart and set its height and width accordingly
Chart chart1 = worksheet.getCharts().get(0);
chart1.getChartObject().setHeight(cshape.getHeight());
chart1.getChartObject().setWidth(cshape.getWidth());
//Making remaining sheets invisible as the output is required for only TransientWorksheet
for (int i = 0; i < ws.getCount(); i++) {
String sheetName = ws.get(i).getName();
if(!transientSheetName.equalsIgnoreCase(sheetName)){
ws.get(i).setVisible(false);
}
}

PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();

pdfSaveOptions.setOnePagePerSheet(true);

worksheet.getPageSetup().setTopMargin(0);
worksheet.getPageSetup().setBottomMargin(0);
worksheet.getPageSetup().setRightMargin(0);
worksheet.getPageSetup().setLeftMargin(0);

workbook.save(“c:/temp/AsposeGenerated.pdf”, pdfSaveOptions);


Can you please look into this issue?

Thanks,
Neeraj

Hi Neeraj,


Thank you for sharing the samples.

We have evaluated the presented scenario while using the latest version of Aspose.Cells for Java 8.6.0.3, and we are able to notice the problem, that is; the Data Label of Chart 1 is getting hidden behind the chart’s title. We have logged this incident in our bug tracking system under the ticket CELLSJAVA-41497 for further investigation & correction. Our product team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.

Hi,

Thanks for using Aspose.Cells.

Please try the latest version: Aspose.Cells for Java (Download | Maven). We have fixed this issue. Let us know your feedback.