UIGauge: Add header, but the charts are still rather broken
This commit is contained in:
parent
07260238c0
commit
1d537e9334
1 changed files with 7 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
|
import Emel from 'emel';
|
||||||
import ApexCharts from 'apexcharts';
|
import ApexCharts from 'apexcharts';
|
||||||
|
|
||||||
import AbstractUIItem from './AbstractUIItem.mjs';
|
import AbstractUIItem from './AbstractUIItem.mjs';
|
||||||
|
@ -13,6 +14,11 @@ class UIGauge extends AbstractUIItem {
|
||||||
constructor(el, def) {
|
constructor(el, def) {
|
||||||
super(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 = {
|
this.chart_options = {
|
||||||
series: [{
|
series: [{
|
||||||
name: def.name,
|
name: def.name,
|
||||||
|
@ -32,7 +38,7 @@ class UIGauge extends AbstractUIItem {
|
||||||
fill: { opacity: 1 },
|
fill: { opacity: 1 },
|
||||||
}
|
}
|
||||||
|
|
||||||
this.chart = new ApexCharts(el, this.chart_options);
|
this.chart = new ApexCharts(el.querySelector(".container-gauge"), this.chart_options);
|
||||||
}
|
}
|
||||||
|
|
||||||
#__update_chart() {
|
#__update_chart() {
|
||||||
|
|
Loading…
Reference in a new issue