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

Free Support Forum - aspose.com

Alignment of header not accurate in Chart's PNG

Hello,

I am using Aspose.Cells v8.6.2.1 to generate PNG of chart - Chart 1 in the attached excel file. In the PNG output, the header extends beyond the chart's border.

Following code is used to generate the output:

void chartToPDF() throws Exception {
Workbook workbook = new Workbook("test.xlsx");
WorksheetCollection ws = workbook.getWorksheets();
String worksheetName = "Sheet1";
Chart chart = ws.get(worksheetName).getCharts().get("Chart 1");
chart.toImage("D:\\response_8.6.3.2.png");
}

Can you please analyse this issue.

Thanks,
Neha

Hi,

Thanks for providing us template file and sample code.

I have tested your scenario/ case using our latest version/fix: Aspose.Cells for Java v8.6.3.4 (please try it), it works fine and I do not find your mentioned issue. Please find attached output PNG file for your reference.
I used the following sample code with your template file.
e.g
Sample code:

Workbook workbook = new Workbook("alignment_of_header.xlsx");
WorksheetCollection ws = workbook.getWorksheets();
String worksheetName = "Sheet1";
Chart chart = ws.get(worksheetName).getCharts().get("Chart 1");
chart.toImage("out1response_8.6.3.4.png");

Thank you.

Hello,


Thanks for your reply.

Can you please test this issue again with the following sample code :

Workbook workbook = new Workbook(“alignment_of_header.xlsx”);
WorksheetCollection ws = workbook.getWorksheets();
String worksheetName = “Sheet1”;
Chart chart = ws.get(worksheetName).getCharts().get(“Chart 1”);
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.setImageFormat(ImageFormat.getPng());
imgOptions.setHorizontalResolution(600);
imgOptions.setVerticalResolution(600);
imgOptions.setOnePagePerSheet(true);
imgOptions.setOnlyArea(false);
chart.toImage(“response_8.6.3.4.png”, imgOptions);

With the above sample code, the issue is reproducible.

For your reference, I have attached response_8.6.3.4.png. If you will zoom-in this PNG, you will see that the header is extending beyond the right border. I have attached a screenshot of the issue.

Can you please analyse this.

Thanks,
Neha

Hi Neha,


Thank you for sharing the updated code snippet, that allowed us to replicate/observe the mentioned problem. We have logged this incident as CELLSJAVA-41681 in our bug tracking system for further analysis. Please spare us little time for investigation. In the meanwhile, we will keep you posted with updates in this regard.

Hi,

Thanks for using Aspose.Cells.

Please download and try the latest fix: Aspose.Cells for Java v8.7.0.2 and let us know your feedback.

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


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.