我怎样才能实现类似这样的东西吗?
我怎样才能实现类似这样的东西吗?
你可以简单地添加其他x轴,它链接到的第一个,并设置适当的周期的时间间隔。 检查演示我贴你下面。
码:
Highcharts.stockChart('container', {
xAxis: [{
type: 'datetime',
tickInterval: 3 * 3600 * 1000, // 3 hours
labels: {
formatter: function() {
return Highcharts.dateFormat('%H:%M', this.value);
}
}
}, {
offset: 40,
type: 'datetime',
linkedTo: 0,
tickInterval: 24 * 3600 * 1000 // one day
}],
series: [{
data: data
}]
});
演示:
https://jsfiddle.net/ngp5o98u/
API参考:
https://api.highcharts.com/highcharts/xAxis.linkedTo