Skip to content

Commit

Permalink
[web-app] fix history echarts chart tooltip only show one instance (#365
Browse files Browse the repository at this point in the history
)
  • Loading branch information
tomsun28 committed Oct 23, 2022
1 parent d198e3e commit b4d1927
Showing 1 changed file with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,7 @@ export class MonitorDataChartComponent implements OnInit {
}
},
tooltip: {
trigger: 'axis',
formatter: function (params: any) {
let time: number = params[0].value[0];
var date = new Date(time);
let seriesName = params[0].seriesName;
let month = (date.getMonth() + 1).toString().padStart(2, '0');
let day = date.getDate().toString().padStart(2, '0');
if (seriesName == null || seriesName == 'NULL') {
return `${date.getFullYear()}/${month}/${day} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()} -- ${
params[0].value[1]
}`;
} else {
return `${seriesName} ${date.getFullYear()}/${month}/${day} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()} -- ${
params[0].value[1]
}`;
}
}
trigger: 'axis'
},
grid: {
left: '2',
Expand All @@ -190,6 +174,12 @@ export class MonitorDataChartComponent implements OnInit {
type: 'time',
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
onZero: false
}
},
yAxis: {
Expand Down

0 comments on commit b4d1927

Please sign in to comment.