Inconsistent HTML output for charts

Hi,

Using Aspose Cells for Java, version 25.2.

Sample code:

Workbook workbook = new Workbook("input.xlsx");
WorksheetCollection worksheets = workbook.getWorksheets();
workbook.calculateFormula();

Worksheet worksheet = worksheets.get("Dashboard");
worksheets.setActiveSheetIndex(worksheet.getIndex());
HtmlSaveOptions saveOptions = new HtmlSaveOptions(SaveFormat.HTML);
saveOptions.setExportActiveWorksheetOnly(true);
saveOptions.setEncoding(Encoding.getUTF8());
saveOptions.setExportImagesAsBase64(true);

workbook.save("output.html", saveOptions);

The attached zip file contains the Excel input, the HTML result, and a picture showing a comparison of the Excel and HTML rendering.

A number of inconsistencies can be observed:

  • the bar chart shows different values than Excel
  • the line over the bar chart is impossible to see, since Aspose seems to be using the wrong colors for that bar chart
  • in general, there seem to be a number of color inconsistencies. For example, compare the rendering of the world map
  • to the right of the “Top 10” section, there is an unexpected vertical grey line
  • the Excel rendering shows a “stopwatch”, while the Aspose rendering shows a “green checkmark”

Kind regards,
Taras
repro.zip (1.4 MB)

@TarasTielkes,

Thanks for the template Excel file, screenshot and output HTML file.

After initial testing, I am able to reproduce the problems as you described by using your template Excel file. I found your mentioned discrepancies/differences when exporting the Excel file to HTML.

We require thorough evaluation of the issue. 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-46271

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.

@TarasTielkes
According to our developers’ research, if you want to achieve the expected effect, you need to call the following code:

//workbook.CalculateFormula();
workbook.Worksheets["Dashboard"].Shapes.UpdateSelectedValue();

If you must call “workbook.CalculateFormula();”, you need to make sure that at least one of the cells “!P16:P25” of the worksheet “02.02 Dashboard Calculation” (which is a hidden worksheet) is true.

1 Like

Hi @TarasTielkes
For the issue of chart rendering inconsistency with excel, we have made the corresponding corrections. The current output result is as follows, and it will take in version 25.4.
250318.png (31.2 KB)