Chart to image issue

Hello.


I have found some issue about building image by excel’s chart. Can you please fix it.

As u can see in excel (test.xlsx) marks of series displays above chart. But when i save chart as image (out.png), looks like marks displays under chart.

public void chart2image() throws Exception {
Workbook wb = new Workbook(“D://test.xlsx”);

Chart chart = wb.getWorksheets().get(0).getCharts().get(0);
File f = new File(“D://out.png”);
try (FileOutputStream out = new FileOutputStream(f)) {
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.setImageFormat(ImageFormat.getPng());
chart.toImage(out, options);
}
}

Best regards. Alexey

Hi,


Thanks for providing us template file.

After an initial test, I observed the issue as you mentioned by converting the chart in the template file to image file format. There are differences regarding the chart’s series marks/ data labels in the output image as you pointed out.
e.g
Sample code:

Workbook wb = new Workbook(“test.xlsx”);

Chart chart = wb.getWorksheets().get(0).getCharts().get(0);
File f = new File(“F://files//out1.png”);
try (FileOutputStream out = new FileOutputStream(f)) {
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.setImageFormat(ImageFormat.getPng());
chart.toImage(out, options);
}

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

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

Thank you.
Hi Alexey,

Thank you for your patience with us.

Please try the latest version of Aspose.Cells for Java 8.2.1.2 as we have fixed the issue logged earlier as CELLSJAVA-40905 with this release. Please feel free to write back in case you face any difficulty.

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


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