我使用Highcharts显示的图表显示大约6天的数据,将缩放默认为1天。但是,它总是缩小到输入的最后24小时(变焦条一直向右)。
如何让它默认一直向左缩放(到输入的最早日期)?
代码:
$('#container').highcharts('StockChart', {
rangeSelector:{
buttons : [{
type: 'day',
count: 1,
text: 'Day'
},
{
type: 'hour',
count: 6,
text: ' 6-Hour '
}],
selected : 0,
inputEnabled: false
},
title : {
text : 'Temperature'
},
series : [
{
name: 'Temperature',
type: 'spline',
yAxis: 0,
data: [[1422979200000, 27], [1422982800000, 27], [1422986400000, 27], [1422990000000, 27], [1422993600000, 28], [1422997200000, 28], [1423000800000, 29], [1423004400000, 29], [1423008000000, 29], [1423011600000, 29], [1423015200000, 29], [1423018800000, 28], [1423022400000, 28], [1423026000000, 28], [1423029600000, 27], [1423033200000, 26], [1423036800000, 27], [1423040400000, 27], [1423044000000, 29], [1423047600000, 28], [1423051200000, 27], [1423054800000, 27], [1423058400000, 26], [1423062000000, 26], [1423065600000, 25], [1423069200000, 24], [1423072800000, 22], [1423076400000, 22], [1423080000000, 21], [1423083600000, 19], [1423087200000, 18], [1423090800000, 17], [1423094400000, 17], [1423098000000, 16], [1423101600000, 15], [1423105200000, 14], [1423108800000, 14], [1423112400000, 13], [1423116000000, 13], [1423119600000, 11], [1423123200000, 11], [1423126800000, 11], [1423130400000, 12], [1423134000000, 12], [1423137600000, 13], [1423141200000, 14], [1423144800000, 14], [1423148400000, 14], [1423152000000, 14], [1423155600000, 13], [1423159200000, 12], [1423162800000, 11], [1423166400000, 10], [1423170000000, 9], [1423173600000, 9], [1423177200000, 8], [1423180800000, 8], [1423184400000, 7], [1423188000000, 7], [1423191600000, 7], [1423195200000, 6], [1423198800000, 6], [1423202400000, 6], [1423206000000, 7], [1423209600000, 7], [1423213200000, 9], [1423216800000, 13], [1423220400000, 16], [1423224000000, 20], [1423227600000, 23], [1423231200000, 26], [1423234800000, 27], [1423238400000, 28], [1423242000000, 28], [1423245600000, 27], [1423249200000, 27], [1423252800000, 26], [1423256400000, 26], [1423260000000, 26], [1423263600000, 25], [1423267200000, 25], [1423270800000, 25], [1423274400000, 25], [1423278000000, 24], [1423281600000, 24], [1423285200000, 24], [1423288800000, 24], [1423292400000, 24], [1423296000000, 24], [1423299600000, 25], [1423303200000, 26], [1423306800000, 28], [1423310400000, 29], [1423314000000, 31], [1423317600000, 31], [1423321200000, 32], [1423324800000, 32], [1423328400000, 32], [1423332000000, 31], [1423335600000, 30], [1423339200000, 29], [1423342800000, 28], [1423346400000, 28], [1423350000000, 28], [1423353600000, 27], [1423357200000, 27], [1423360800000, 26], [1423364400000, 26], [1423368000000, 26], [1423371600000, 26], [1423375200000, 25], [1423378800000, 25], [1423382400000, 25], [1423386000000, 25], [1423389600000, 26], [1423393200000, 27], [1423396800000, 27], [1423400400000, 28], [1423404000000, 28], [1423407600000, 28], [1423411200000, 28], [1423414800000, 26], [1423418400000, 24], [1423422000000, 22], [1423425600000, 21], [1423429200000, 20], [1423432800000, 19], [1423436400000, 18], [1423440000000, 17], [1423443600000, 16], [1423447200000, 16], [1423450800000, 15], [1423454400000, 14], [1423458000000, 14], [1423461600000, 13], [1423465200000, 12], [1423468800000, 12], [1423472400000, 13], [1423476000000, 15], [1423479600000, 17], [1423483200000, 18], [1423486800000, 19], [1423490400000, 20], [1423494000000, 21], [1423497600000, 21], [1423501200000, 20], [1423504800000, 19], [1423508400000, 18], [1423512000000, 17], [1423515600000, 16], [1423519200000, 15], [1423522800000, 15], [1423526400000, 14], [1423530000000, 14], [1423533600000, 13], [1423537200000, 13], [1423540800000, 12], [1423544400000, 12], [1423548000000, 12], [1423551600000, 12], [1423555200000, 12], [1423558800000, 13], [1423562400000, 16], [1423566000000, 18], [1423569600000, 20], [1423573200000, 22], [1423576800000, 24], [1423580400000, 25]],
color: "#43E043"
}]
});
});
示例:http://jsfiddle.net/8kg2vy46/
如您所见,最早的日期是“2月3日16:00”,但它默认缩放开始“2月9日,15:00”。