highstocks 上的 maxPadding
maxPadding on highstocks
我搜索过 highstocks 不支持 maxPadding(根据这个 post Highstock - why is min/maxPadding on xAxis ignored),Highstocks 是否有其他替代方案?
感谢您的帮助。
如果不使用ordinal axis, you can expand range programmatically on xAxis.events.setExtremes.
xAxis: {
minPadding: 0.1,
maxPadding: 0.1,
ordinal: false,
events: {
setExtremes: function(e) {
if (e.trigger) {
e.preventDefault()
const navigator = this.chart.xAxis[1]
let { min, max } = e
const range = navigator.max - navigator.min
if (max === navigator.max) max += 0.1 * range
if (min === navigator.min) min -= 0.1 * range
this.setExtremes(min, max)
}
}
}
},
我搜索过 highstocks 不支持 maxPadding(根据这个 post Highstock - why is min/maxPadding on xAxis ignored),Highstocks 是否有其他替代方案?
感谢您的帮助。
如果不使用ordinal axis, you can expand range programmatically on xAxis.events.setExtremes.
xAxis: {
minPadding: 0.1,
maxPadding: 0.1,
ordinal: false,
events: {
setExtremes: function(e) {
if (e.trigger) {
e.preventDefault()
const navigator = this.chart.xAxis[1]
let { min, max } = e
const range = navigator.max - navigator.min
if (max === navigator.max) max += 0.1 * range
if (min === navigator.min) min -= 0.1 * range
this.setExtremes(min, max)
}
}
}
},