From b3baead24f0b5857bda4b08b6f804eae6c53ea4c Mon Sep 17 00:00:00 2001 From: Musilah Date: Fri, 8 Mar 2024 16:10:11 +0300 Subject: [PATCH] fix multigauge Signed-off-by: Musilah --- ui/web/static/js/charts.js | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/ui/web/static/js/charts.js b/ui/web/static/js/charts.js index 386c14d5..ef5f7158 100644 --- a/ui/web/static/js/charts.js +++ b/ui/web/static/js/charts.js @@ -679,7 +679,6 @@ class GaugeChart extends Echart { ); if (response.ok) { const data = await response.json(); - console.log("message:", data.messages); gaugeChart.setOption({ series: [ { @@ -1159,23 +1158,43 @@ class MultiGaugeChart extends Echart { ); if (response.ok) { const data = await response.json(); - console.log("message:", data.messages); multiGaugeChart.setOption({ series: [ { data: [ - { + { value: data.messages[0].value, name: '${gaugeLabel[0]}', + title: { + offsetCenter: ['0%', '-30%'] + }, + detail: { + valueAnimation: true, + offsetCenter: ['0%', '-18%'] + } }, - { + { value: data.messages[1].value, name: '${gaugeLabel[1]}', + title: { + offsetCenter: ['0%', '0%'] + }, + detail: { + valueAnimation: true, + offsetCenter: ['0%', '12%'] + } }, - { + { value: data.messages[2].value, name: '${gaugeLabel[2]}', - }, + title: { + offsetCenter: ['0%', '28%'] + }, + detail: { + valueAnimation: true, + offsetCenter: ['0%', '40%'] + } + } ], }, ], @@ -1532,7 +1551,6 @@ class SpeedGaugeChart extends Echart { ); if (response.ok) { const data = await response.json(); - console.log("message:", data.messages); speedGaugeChart.setOption({ series: [ { @@ -1841,7 +1859,6 @@ class TempGaugeChart extends Echart { if (response.ok) { const data = await response.json(); var newValue = data.messages[0].value; - console.log("message:", data.messages); tempGaugeChart.setOption({ series: [ {