Excel Chart into image (.jpeg) : wrong export

When I tried exporting a range of cells containing an Excel Pie chart into JPEG file, I experienced something strange. My two test charts are generated from flat table data source.
As you notice, the Bar chart (FLAT_CHART_100) is quite well exported (excluding shadows behind bars but this is a detail). However, the Pie Chart (FLAT_CHART_101) definition is not respected : the serie is incorrect so the slices colors are shifted, and the semicolon separators became comma.

You can find attached a test application, excel workbook + JPEG exports :
sampledatainsuranceChartsToIMG.zip (207.7 KB) (tabs FLAT_CHART_100 and FLAT_CHART_101)
TestAppExportChartToIMG.zip (1.9 KB)
PieChartImg.jpeg (158.8 KB)
BarChartImg.jpeg (289.3 KB)

Please could you advise me on the code, or tell me if there is a bug to fix.

Thank you

@GVA32156,

Thanks for the template file and screenshots.

After an initial test, I reproduced the issue as you mentioned by using your template file. I found when rendering Excel chart into image (.jpeg), it produces wrong export. For example, the series are incorrect with the slices colors shifted. We need to evaluate your issue in details.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSJAVA-45423

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@GVA32156,

I do not see semicolon when viewing the chart in MS Excel, see the screenshot on how the chart looks like on my end.
sc_shot1.png (104.5 KB)

Could you please share the screenshot on how the chart is displayed on your end when viewing into MS Excel manually. Also, give us your environment details (OS, regional/locale settings, .NET framework version, MS Excel version and language settings, etc.).

Here is my Chart displayed : pieChartExcel.JPG (133.7 KB)

Windows 10 Enterprise

ExcelLanguageSettings.png (23.6 KB)

MS Office Professional Plus 2016

formatSettings.png (12.8 KB)

regionSettings.png (6.1 KB)

Please let me know if something else needed

@GVA32156,

Thanks for the screenshots and details regarding your MS Excel display of the chart and OS regional settings. We will evaluate your issue soon.

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

Something interesting I observed after many tests, you can try out on your side :

  • Open the Excel workbook I provided

  • Save the file manually (even if you modified nothing) : saveFileMsgBox.png (5.0 KB)

  • Then run the test code again

And as you can see I got the correct result for Pie Chart export :
BarChartImg.jpeg (289.3 KB)
PieChartImg.jpeg (165.6 KB)

I am not able to explain precisely, but it sounds like it is related to the bug I reported on this topic : Issue copying worksheet containing Pivot Table - #5 by GVA32156
An intermediate saving of the workbook is fixing the gap of commands expected before creating a clean copy, or in our case here before exporting a range of cells.

@GVA32156,

Thanks for sharing your findings.

We have logged your screenshots and details with the existing ticket into our database. Please spare us little time to investigate your issue thoroughly. Hopefully we will figure out your issue soon.

Hello @amjad.sahi, has this bug been evaluated ? And also “New editing and saving of the workbook is fixing the problem.” mystery
Simply to know if the complexity is high to fix or not

Thank you

Hi @GVA32156
Progress so far: we have made progress on the problem of the delimiter error, which we hope to fix in the next release. The problem of the color error in the pie chart is a bit more complicated, and we’re still analyzing it.

1 Like

Hi @GVA32156
The problem with separators has been resolved in version 23.6. Please get the new version and let us know your feedback.

We’re working on the rest problems.

Hi @GVA32156
For the legend and color confusion problem, we solved the effect as follows. It’ll take effect in the next version(23.7).
230625.png (12.7 KB)

The problem with delimiters was resolved in the last version(23.6).

The issues you have found earlier (filed as CELLSJAVA-45423) have been fixed in Aspose.Cells for Java 23.7.