最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Background color to highcharts - Stack Overflow

programmeradmin4浏览0评论

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
Add a ment  | 

2 Answers 2

Reset to default 7

You 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.

发布评论

评论列表(0)

  1. 暂无评论