UIGauge: Add header, but the charts are still rather broken

This commit is contained in:
Starbeamrainbowlabs 2022-04-03 02:41:58 +01:00
parent 07260238c0
commit 1d537e9334
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 7 additions and 1 deletions

View File

@ -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() {