Changing HighCharts background color?
css, highcharts, javascript, jquery
Solution
Take a look at the Highcharts API here: https://api.highcharts.com/highcharts/chart.backgroundColor and you will see it's a property of the chart object that can take a solid color:
{
chart: {
backgroundColor: '#FCFFC5',
polar: true,
type: 'line'
}
}
Or Gradiant:
{
chart: {
backgroundColor: {
linearGradient: [0, 0, 500, 500],
stops: [
[0, 'rgb(255, 255, 255)'],
[1, 'rgb(200, 200, 255)']
]
},
polar: true,
type: 'line'
}
}
Problem
I don't really know how to do this. I need to change background color of this highcharts chart: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/polar-spider/ But I don't seem to be able to do so - there doesn't seem to be any clear place to put the background color setting? I've tried to write many different values in this section: ``` chart: { polar: true, type: 'line' }, ``` But it didn't do anything ( it occasionally broke this script ). Do I need to change it somewhere in the included .js files? Or can it be done from the level of this loaded script? JS is really confusing. Can anyone help me?