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)
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