设置yAx的y值后,条形的其余部分不会出现。例如。在代码中我将y值设置为20但在20之后没有任何内容。所以我要做的是将所有线延伸到最大值并保持20。
截图
Highcharts.chart("container1", {
chart: {
marginTop: 40
},
title: {
text: "Gauge Bar Chart"
},
xAxis: {
categories: [
'<span class="hc-cat-title">Revenue</span><br/>U.S. $ (1,000s)'
]
},
yAxis: {
plotBands: [
{
from: 0,
to: 1400,
color: "#ffffff"
}
],
labels: {
format: "{value}%"
},
title: null,
max: 100,
visible: true
},
series: [
{
animation: false,
data: [
{
y: 20,
target: 40
}
]
}
],
您可以将plotBands
添加到所有xAxis
,例如:
xAxis: {
...,
plotBands: [{
from: -0.18,
to: 0.15,
color: "gray"
}]
},