msb_test
向文可 2 years ago
parent 7dc8ce6a1e
commit ed30db4a3e

@ -76,7 +76,13 @@
}); });
}, 100) }, 100)
); );
const handleChart = (selector, name, data) => { const handleChart = (
selector,
name,
data,
formatter = (params) =>
`${params[0].axisValue}<br/><span style="color:${params[0].color};font-size:20px;margin-right:5px;">●</span>${params[0].seriesName}<b style="margin-left:10px;">${params[0].value}</b>`
) => {
let chart = charts.value[selector]; let chart = charts.value[selector];
chart?.dispose(); chart?.dispose();
chart = charts.value[selector] = echarts.init(document.querySelector(selector)); chart = charts.value[selector] = echarts.init(document.querySelector(selector));
@ -93,6 +99,7 @@
], ],
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
formatter,
}, },
grid: { grid: {
left: '0', left: '0',
@ -157,7 +164,9 @@
label: item.hours, label: item.hours,
value: item.messageCount, value: item.messageCount,
}; };
}) }),
(params) =>
`${params[0].axisValue}:00 - ${params[0].axisValue}:59<br/><span style="color:${params[0].color};font-size:20px;margin-right:5px;">●</span>${params[0].seriesName}<b style="margin-left:10px;">${params[0].value}</b>`
); );
} }
); );

Loading…
Cancel
Save