Echarts重写tooltip(提示框)代码
let option = {
tooltip: {
trigger: "axis",
formatter: (params) => {
// console.log(params);
let res = "";
let html = "";
for (let i = params.length - 1; i >= 0; i--) {
let count = nubToStrUnit(params[i].value);
html = '<div style="padding-bottom:2px;">' + params[i].name + "</div>";
res +=
'<div style="padding:0px 0;">' +
params[i].marker +
params[i].seriesName +
'<span style="float:right;padding-left:15px;">' +
regexHandleNum(count.value, 0, 1) +
count.unit +
"次</span>" +
"次</div>";
}
return html + res;
},
},
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
上次更新: 2024/02/23, 14:32:48
- 01
- Node与GLIBC_2.27不兼容解决方案08-19
- 02
- Git清空本地文件跟踪缓存08-13