highcharts 的背景颜色

Background color to highcharts

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

我的图表需要有背景色,但 highcharts 中不需要标签。 可以吗,谁能帮我一下。

此处示例 link 具有背景色的图表。

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

jsFiddle

但我需要的是:

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

.highcharts-plot-background 就是您要找的。将此添加到您的 CSS:

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

实例:jsFiddle.

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

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

已更新fiddle: