系列很好,但是xaxis是颠倒的,但是代码“reversed: true”是Yaxis正确顺序所必需的
总之,对于这个例子,我只需要反转 Xaxis:
$(function() {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'line',
},
xAxis: {
type: 'datetime',
reversed: true,
labels: {
formatter: function() {
return Highcharts.dateFormat('%m/%d/%y', this.value, true);
}
},
showLastLabel: true
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
pointInterval: 1 * 3600 * 1000,
pointStart: (new Date()).getTime() - 1 * 24 * 3600 * 1000
}]
});
});