我想将最后一个绘图带值(225)显示为 x 轴上的最大值。在图片中您可以看到 x 轴最大值为 300,这就是创建间隙的原因。我想将 plotband 最大值 225 显示为 x 轴上的最大值。所以差距会消除。
Highcharts.chart('container1', {
chart: {
marginTop: 20,
width: 225,
height: 80
},
title: {
text: ''
},
xAxis: {
categories: ['<span class="hc-cat-title">Revenue</span><br/>']
},
yAxis: {
plotBands: [{
from: 0,
to: 132,
color: '#666'
}, {
from: 132,
to: 157.7,
color: '#999'
}, {
from: 157.7,
to: 225,
color: '#bbb'
}],
title: null
},
series: [{
data: [{
y: 225,
target: 157.7
}]
}],
tooltip: {
pointFormat: '<b>{point.y}</b> (with target at {point.target})'
}
});
Jsfiddle:子弹图