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

Free Support Forum - aspose.com

Mistakes in created image from pie chart

when I create a pie chart in Excel it will look like the attachment ‘Diagrammtest.PNG’, but when I open the file with aspose.Cells and extract the chart to create an image, the result is attachment ‘Diagrammtest_Aspose.png’. As you can see, the lines do not meet correctly in the middle and between the 8% and 20% section in the top right ‘corner’ of the chart the 8% section does not finish correctly (you might have to scroll a few times to see it clearly).
The only difference between my code and the example code is that I set the horizontal and vertical resolution to five times the standard value.
Thank you very much in advance.


Could you attach your template Excel file containing the chart and paste the sample code here, we will check your issue soon.

Also, could you give more details and screen shots for the second issue mentioned i.e., "…in the top right ‘corner’ of the chart the 8% section does not finish correctly (you might have to scroll a few times to see it clearly)"

Thank you.
private void generateImage(Workbook workbook, OutputStream outputStream,<br>            MimeTypeImage outputType, int chartOnPage) {<br>        try {      <br>            ImageOrPrintOptions imgOpts = new ImageOrPrintOptions();<br><br>            imgOpts.setImageFormat(ImageFormat.getPng());<br><br>            Chart chart = workbook.getWorksheets().get(chartOnPage).getCharts()<br>                    .get(0);<br><br>            imgOpts.setHorizontalResolution(imgOpts.getHorizontalResolution()*10);<br>            imgOpts.setVerticalResolution(imgOpts.getVerticalResolution()*10);<br>            chart.toImage(outputStream, imgOpts);<br>}<br>...<br><br>The second issue, is basically that if you look closely at the edge of the chart between the section 'Anteil A' with 8% and the section 'Anteil B' with 20% you will see that the border of the 8% section does not match well with the 20% section. <br><br>Edit: I copy pasted your example http://www.aspose.com/docs/display/cellsjava/Converting+Chart+to+Image and changed the chart to 'PIE' and multiplied the resolution with 10 and received the same mistakes.<br>

Hi Gerald,

Thanks for your posting and using Aspose.Cells for Java.

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 8.1.0.

I have highlighted the issues with red rectangles in the generated image. I have attached the generated image for a reference.

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-40849.


Workbook wb = new Workbook(filePath);

Worksheet worksheet = wb.getWorksheets().get(0);

Chart chart = worksheet.getCharts().get(0);

ImageOrPrintOptions imgOpts = new ImageOrPrintOptions();




chart.toImage(filePath + “.out.png”, imgOpts);
Hi Gerald,

Thank you for your patience with us.

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

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

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