I have a requirement and I can't seem to figure out how to do it.
I need to have a background color to my chart but not labels in highcharts. Is it possible, can anybody help me with this.
Sample link here for chart with a background color.
chart: {
backgroundColor: '#FCFFC5',
type: 'line'
},
jsFiddle
But what I need is:
In this image the area which is covered in red section need to have no background color.
I have a requirement and I can't seem to figure out how to do it.
I need to have a background color to my chart but not labels in highcharts. Is it possible, can anybody help me with this.
Sample link here for chart with a background color.
chart: {
backgroundColor: '#FCFFC5',
type: 'line'
},
jsFiddle
But what I need is:
In this image the area which is covered in red section need to have no background color.
Share Improve this question edited Jul 20, 2016 at 13:17 Mike Zavarello 3,5544 gold badges30 silver badges43 bronze badges asked Jul 18, 2016 at 17:51 Sai Babu BSai Babu B 1622 silver badges14 bronze badges 1- 1 If you had just keep looking at the docs you would see that there is a plotBackGroundColor option – ODelibalta Commented Jul 18, 2016 at 17:56
2 Answers
Reset to default 7You can set the chart background color and the plot area background color separately:
chart: {
backgroundColor: '#fff',
plotBackgroundColor: '#fcffc5'
}
Updated fiddle:
- http://jsfiddle/jlbriggs/cfrfjuvz/1/
.highcharts-plot-background
is what you are looking for. Add this to your CSS:
.highcharts-plot-background {
fill: #FCFFC5;
}
.highcharts-plot-border {
stroke-width: 2px;
stroke: #7cb5ec;
}
Live example: jsFiddle.