[Y轴点之间的差异较大时,Highcharts不会渲染较小的点。
这里是一个例子:https://jsfiddle.net/Lnbz3wtx/1/
图表代码:
Highcharts.chart('container', {
chart: {
type: 'column'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
/* plotOptions: {
series: {
minPointLength: 2 // I've tried setting minPointLength but it shows even for 0 values
}
}, */
series: [{
data: [500, 1]
}]
});
而不是将数据值设置为0,您可以将null
与minPointLength
结合使用。
Highcharts.chart('container', {
chart: {
type: 'column'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
plotOptions: {
series: {
minPointLength: 3
}
},
series: [{
data: [500, 1, null, null, null, null, null, null, null, null, null, null]
}]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>