admin管理员组文章数量:1333199
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.
本文标签: javascriptBackground color to highchartsStack Overflow
版权声明:本文标题:javascript - Background color to highcharts - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742276973a2445378.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论