1 回答

TA贡献1875条经验 获得超3个赞
请注意,在日期时间轴的 Highharts 中,X 值是自 1970 年以来以毫秒为单位的时间戳。因此您的值不是分钟而是毫秒。
要实现您想要的目标,您必须映射 CSV 数据以制作分钟时间戳并更改 xAxis 标签和工具提示内容呈现点日期的方式。检查下面发布的演示和代码。
代码:
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
}
添加回答
举报