[Fixed] How to export highcharts with specified fill color for highcharts background?

Issue

I have highcharts defined in angular and with the help of a toggle-button,
I can alter the .highcharts-background color (which is done using css files).
This is working fine on the browser, but when exported I am getting default white color.
Any help is welcomed.

Solution

If you don’t use styled mode, styles from CSS classes will not be applied on an exported chart. Use backgroundColor property instead:

chart: {
  backgroundColor: 'red'
}

Live demo: http://jsfiddle.net/tsjmkrbw/

Docs: https://www.highcharts.com/docs/chart-design-and-style/style-by-css

API Reference:

https://api.highcharts.com/highcharts/chart.styledMode

https://api.highcharts.com/highcharts/chart.backgroundColor

Leave a Reply

(*) Required, Your email will not be published