var tooltipConfig = {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' + this.point.y + '<br/>' +
getLocalTime(this.point.x);
},
dateTimeLabelFormats: {
millisecond: '%H:%M:%S.%L',
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%Y-%m-%d',
week: '%m-%d',
month: '%Y-%m',
year: '%Y'
}
};
function getLocalTime(nS) {
var date = new Date(nS);
return date.getFullYear() + "/" + fomat(date.getMonth() + 1) + "/" + fomat(date.getDate()) + " " + fomat(date.getHours()) + ":" + fomat(date.getMinutes()) + ":" + fomat(date.getSeconds());
}
function fomat(data)
{
return (data > 9 ? data : "0" + data);
}
在chart初始化中,增加
tooltip: tooltipConfig,
即可解决