问题
How can I achieve something similar to this?
回答1:
You can simply add another xAxis, linked it to the first one and set appropriate tick interval. Check demo I posted you below.
Code:
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
}]
});
Demo:
https://jsfiddle.net/ngp5o98u/
Api reference:
https://api.highcharts.com/highcharts/xAxis.linkedTo
来源:https://stackoverflow.com/questions/53823190/highcharts-how-can-i-achiveve-multiple-rows-on-chart-labels