From e14f77b6184c8c58964645afa12e2ada6a966eed Mon Sep 17 00:00:00 2001 From: Lijo Antony Date: Tue, 26 Jul 2022 16:43:51 +0400 Subject: [PATCH] [FIX] kpi_dashboard: Meter widget supports customization using parameters Meter widget is implemented with GaugeMeter (https://github.com/Mictronics/GaugeMeter). GaugeMeter provides a number of parameters to customize its display. See https://github.com/Mictronics/GaugeMeter#parameter-definitions for details. Allow user to customize GaugeMeter by setting the customization parameters in the result. This mechanism can be used to show actual values instead of percentages by setting total, used & showvalue parameter in the result. Fixes #428 --- kpi_dashboard/demo/demo_dashboard.xml | 8 +++++--- kpi_dashboard/readme/CONFIGURE.rst | 2 +- kpi_dashboard/static/src/js/widget/meter_widget.js | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/kpi_dashboard/demo/demo_dashboard.xml b/kpi_dashboard/demo/demo_dashboard.xml index 7b04070a9..c8249bdd8 100644 --- a/kpi_dashboard/demo/demo_dashboard.xml +++ b/kpi_dashboard/demo/demo_dashboard.xml @@ -29,17 +29,19 @@ /> Meter 01 - + % code meter - result = {"min": 0, "max": 100, "value": 90} + result = {"value": 90} Meter 02 $ code meter - result = {"min": 0, "max": 100, "value": 40} + result = {"min": 0, "total": 200, "used": 90, showvalue: True}