我是highcharts的新手。我最近一直在绘制highcharts。我正在使用绘图带来绘制背景色。如果值存在,则必须对其进行着色;如果值不存在,则不应对其进行着色。
例如,在此图表中,对于橙色,阴影效果很好,因为正侧和负侧都有值。但是对于香蕉,阴影是不正确的。它只有正值,所以只有正边应该着色,而不是负边,即0到-2.5不应该用灰色着色。
任何帮助都是非常感谢的。
带图带的Highchart列:

代码如下:
Highcharts.chart('container', {
chart: {
type: 'column'
},
title: {
text: 'Column chart with negative values'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas'],
plotBands: [{
color: 'gray',
from: 0.5,
to: 1.5
},
{
color: 'gray',
from: 3.5,
to: 4.5
}],
},
credits: {
enabled: false
},
series: [{
name: 'John',
data: [5, 3, 4, 7, 2]
}, {
name: 'Jane',
data: [2, -2, -2, 2, 1]
}, {
name: 'Joe',
data: [3, 4, 4, -2, 5]
}]
}); https://stackoverflow.com/questions/51874422
复制相似问题