From a9833f47f0efccba58a4b518b81315b59a4bdff2 Mon Sep 17 00:00:00 2001 From: unitwk Date: Sat, 2 Sep 2023 22:57:21 +0800 Subject: [PATCH] Fix: chart max error --- frontend/src/widgets/RequestChart.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/widgets/RequestChart.vue b/frontend/src/widgets/RequestChart.vue index 7e01bf54..b9daa3e9 100644 --- a/frontend/src/widgets/RequestChart.vue +++ b/frontend/src/widgets/RequestChart.vue @@ -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