You need to configure buttons if you want the range selector
xAxis: {
events: {
afterSetExtremes: function(e) {
var minDistance = 36 * 30 * 24 * 3600 * 1000; //36 months time
var xaxis = this;
if ((e.max - e.min) < minDistance) {
var min = e.max - minDistance;
var max = e.max;
window.setTimeout(function() {
xaxis.setExtremes(min, max);
}, 1);
}
}
}
}
rangeSelector: {
selected : 1,
buttons: [{
type: 'month',
count: 36,
text: '36m'
}, {
type: 'month',
count: 42,
text: '42m'
}, {
type: 'month',
count: 48,
text: '48m'
}, {
type: 'month',
count: 54,
text: '54m'
}, {
type: 'all',
text: 'All'
}]
}
working jsFiddle: http://jsfiddle.net/Zd5Cn/
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…