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

Free Support Forum - aspose.com

Chart's wrong exports to images

Hi. I found, that certain charts exports wrong. You can check following test:



public void saveChart(Chart chart, String fileName) throws Exception {
File f = new File(fileName);
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(f))) {
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.setImageFormat(ImageFormat.getPng());

chart.toImage(out, options);
}
}

@Test
public void chartTest() throws Exception {
saveChart(new Workbook(“D://test1.xlsx”).getWorksheets().get(“Данные”).getCharts().get(“grah”), “D://test1.png”);
saveChart(new Workbook(“D://test2.xlsx”).getWorksheets().get(“Данные”).getCharts().get(“grah1”), “D://test2.png”);
}

Hi Alexey,


Thank you for sharing the code and samples.

We have evaluated the presented scenarios while using the latest version of Aspose.Cells for Java 16.11.10, and we are able to notice both mentioned problems. Moreover, we have noticed another issue, that is; vertical axis values of the chart in sample test1.xlsx does not correspond to the image of same chart. We have noticed that the Series “Использование газа БП, тыс.м3” (Red horizontal line) exists somewhere between 80 & 90 on right vertical axis, however, in chart 's image same series is on 100. Please refer to attached image.

Please find the ticket details as follow.

  • CELLSJAVA-42105: DataTable series are missing while exporting chart to image
  • CELLSJAVA-42106: Vertical axis values do not correspond to the chart while exporting to image
  • CELLSJAVA-42107: Chart is vertically suppressed while rendering to image

Please spare us little time to properly evaluate these cases and get back with updates for your reference.

Hi. Also we have found trouble with shadows in charts


public void saveChart(Chart chart, String fileName) throws Exception {
File f = new File(fileName);
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(f))) {
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.setImageFormat(ImageFormat.getPng());

chart.toImage(out, options);
}
}

@Test
public void chartTest() throws Exception {
saveChart(new Workbook(“D://00000001.xlsx”).getWorksheets().get(“Лист1”).getCharts().get(“graph”), “D://00000001.png”);
}
Chart’s yellow columns have a shadow, that not rendered in png

Best regards. Alexey

Hi,


Thanks for your posting and using Aspose.Cells.

We were able to observe this issue after converting your chart into image using the following code with the latest version: Aspose.Cells for Java v16.11.10 and found the issue as per your description and screenshot. Shadow of the chart is not being rendered in the output image.

We have logged this issue in our database for investigation. We will look into it and fix this issue. Once the issue is resolved or we have some other update for you, we will let you know asap.

This issue has been logged as

  • CELLSJAVA-42115 - Chart shadow is not displayed in the output chart image

I have also attached the output pdf generated with this code which shows the chart image.

Java
Workbook wb = new Workbook(dirPath + “00000001.xlsx”);

Chart ch = wb.getWorksheets().get(“Лист1”).getCharts().get(0);
ch.toPdf(dirPath + “chart.pdf”);

Hi. What about this issue?

Hi Alexey,


I am afraid, all the tickets attached to this thread are currently unresolved. We have requested the concerned member of the product team to share insight of the reported problems as well as the ETA for the fix, if possible. We will share more details as soon as we receive any.

Hi,


This is to update you that we are working over your issue “CELLSJAVA-42105” and hopefully, we will provide you the fixed version before the end of next week or so.

Keep in touch.

Thank you.

Hi,

Thanks for using Aspose.Cells.

For your issue

  • CELLSJAVA-42115 - Chart shadow is not displayed in the output chart image

We are afraid, shadow is not supported and we cannot fix this issue because it is too complex for us and we have no plan to do it.

Hi,

Thanks for using Aspose.Cells.

Please download and try the following latest fix: Aspose.Cells for Java v17.1.5 and let us know your feedback.

It fixes the following issues

  • CELLSJAVA-42105 - DataTable series are missing while exporting chart to image
  • CELLSJAVA-42107 - Chart is vertically suppressed while rendering to image

Hi. We have tested it and it works now. Thank you

Hi again,

Thank you for the confirmation. It is good to know that you are up & running again. Please feel free to contact us back in case you need our further assistance with Aspose APIs.

The issues you have found earlier (filed as CELLSJAVA-42107;CELLSJAVA-42105) have been fixed in Aspose.Cells for Java 17.2.0.


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

@makarovalv,
Please try our latest version aspose.cells-for-java-21.6.
Your issue(filed as CELLSJAVA-42106) should be fixed now.
Let us know your feedback