【问题标题】:Background color to highchartshighcharts的背景颜色
【发布时间】:2016-11-21 10:25:07
【问题描述】:

我有一个要求,但我似乎不知道该怎么做。

我需要为我的图表设置背景颜色,但不需要在 highcharts 中添加标签。 有没有可能,谁能帮帮我。

此处为带有背景颜色的图表的示例链接。

 chart: {
        backgroundColor: '#FCFFC5',
        type: 'line'
    },

jsFiddle

但我需要的是:

在这张图片中,被红色部分覆盖的区域不需要背景色。

【问题讨论】:

标签: javascript css highcharts background-color


【解决方案1】:

.highcharts-plot-background 是您正在寻找的。将此添加到您的 CSS

.highcharts-plot-background {
    fill: #FCFFC5;
}
.highcharts-plot-border {
    stroke-width: 2px;
    stroke: #7cb5ec;
}

实时示例:jsFiddle

【讨论】:

    【解决方案2】:

    您可以分别设置图表背景颜色和绘图区域背景颜色:

    chart: {
      backgroundColor: '#fff',
      plotBackgroundColor: '#fcffc5'
    }
    

    更新小提琴:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-07
      相关资源
      最近更新 更多