Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing HighCharts background color?

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?

like image 493
user3010273 Avatar asked Dec 22 '13 15:12

user3010273


People also ask

How do I change text color in Highcharts?

You can use plotOptions and setting color for each series type. For example if you need changing color dataLabels plotOptions. bar. dataLabels.

Is Highcharts responsive?

Since Highcharts 5.0 you can create responsive charts much the same way you work with responsive web pages. A top-level option, responsive, exists in the configuration. One of the most handy options is chart.


1 Answers

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'
  }
}
like image 118
Omnilord Avatar answered Sep 22 '22 07:09

Omnilord