Fix: chart max error

This commit is contained in:
unitwk 2023-09-02 22:57:21 +08:00
parent e82ab043cf
commit a9833f47f0

View File

@ -23,7 +23,11 @@ watch(state, () => {
const v = source[key] as JsonData;
v.time = `${MAX_TIME - Number(key) * 1} MIN`;
}
const max = Math.max(...source.map((v) => v.value));
chart.setOption({
yAxis: {
max
},
dataset: {
dimensions: ["time", "value"],
source