在高图表中,当我在图表中的x轴上设置endOnTick true时,则图表在x轴的末尾显示未指定的值
Highcharts.chart('container', {
chart: {
type: "line",
plotBorderWidth: 1
},
title: {
text: 'endOnTick is true by default'
},
subtitle: {
text: 'yAxis is rounded up to next tick and stops at 250'
},
xAxis: {
linear: [0,1,2],
endOnTick: true
},
yAxis: {
//endOnTick: false
},
series: [{
data: [23,76,45]
}]
});
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="height: 400px"></div>
这与maxPadding
属性有关,默认情况下该属性设置为0.01
。
xAxis: {
...,
maxPadding: 0,
endOnTick: true
}
现场演示:http://jsfiddle.net/BlackLabel/6m4e8x0y/4762/
API 参考:https://api.highcharts.com/highcharts/xAxis.maxPadding