1 回答

TA貢獻(xiàn)1875條經(jīng)驗(yàn) 獲得超3個(gè)贊
請(qǐng)注意,在日期時(shí)間軸的 Highharts 中,X 值是自 1970 年以來(lái)以毫秒為單位的時(shí)間戳。因此您的值不是分鐘而是毫秒。
要實(shí)現(xiàn)您想要的目標(biāo),您必須映射 CSV 數(shù)據(jù)以制作分鐘時(shí)間戳并更改 xAxis 標(biāo)簽和工具提示內(nèi)容呈現(xiàn)點(diǎn)日期的方式。檢查下面發(fā)布的演示和代碼。
代碼:
xAxis: {
title: {
enabled: true,
text: 'Minutes'
},
type: 'datetime',
dateTimeLabelFormats: {
minute: '%M',
hour: '%H:%M',
day: '%H:%M',
week: '%e. %b',
month: '%b \'%y',
year: '%Y'
}
},
tooltip: {
formatter: function () {
const points = this.points;
return [
Highcharts.dateFormat('%H:%M', this.x),
'Series1: ' + points[0].y,
'Series2: ' + points[1].y
];
},
split: true
}
添加回答
舉報(bào)