diff --git a/src/static/js/ui/UIGauge.mjs b/src/static/js/ui/UIGauge.mjs index 7c5f990..e3d3505 100644 --- a/src/static/js/ui/UIGauge.mjs +++ b/src/static/js/ui/UIGauge.mjs @@ -1,5 +1,6 @@ "use strict"; +import Emel from 'emel'; import ApexCharts from 'apexcharts'; import AbstractUIItem from './AbstractUIItem.mjs'; @@ -13,6 +14,11 @@ class UIGauge extends AbstractUIItem { constructor(el, def) { super(el, def); + this.emel = new Emel().emel; + this.el.replaceChildren(this.emel(`h3{?}+div[class="container-gauge"]`, { + placeholders: [ this.def.name ] + })); + this.chart_options = { series: [{ name: def.name, @@ -32,7 +38,7 @@ class UIGauge extends AbstractUIItem { fill: { opacity: 1 }, } - this.chart = new ApexCharts(el, this.chart_options); + this.chart = new ApexCharts(el.querySelector(".container-gauge"), this.chart_options); } #__update_chart() {