Highcharts exports images with black background

Created on 18 March 2024, 9 months ago
Updated 28 March 2024, 9 months ago

Problem

Exporting images to JPG results in charts with a black background. This can be prevented by setting a white background on charts.

I don't think this was happening around the time of 5.0.8. But I think it's something that comes from highcharts export service (all exports are handled by their servers). Perhaps they were handling an empty (none) value differently before? I can't find release notes.

One way of dealing with this issue for new charts is to set a default background color value of white, then all newly created charts will have it by default and they will work as expected when exported. Unfortunately, existing ones will not automatically inherit this value as it is saved to each chart as empty.

Steps to reproduce

Create a chart without setting a background color. Then view chart and use export feature to generate chart to JPG. This will/should result in a chart on a black background.

Then, change the background to #FFFFFF, when exporting this will/should generate a chart on a white background.

Proposed resolution

  • If no background has been provided, set background color to white for JPG exports, and to a transparent background for PNG exports. (not sure if that's possible?)
  • Can anyone confirm if this was indeed a change in highcharts? if so, could they handle it differently? I've submitted an issue to inquire out about this but if a value of 'none' was invalid, then the change makes sense and the code here needs to be addressed by something like the point above.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

5.0

Component

Highcharts integration

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024