@record-evolution/widget-gauge 1.7.6 → 1.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "REWidget widget-gauge",
4
4
  "license": "MIT",
5
5
  "author": "widget-gauge",
6
- "version": "1.7.6",
6
+ "version": "1.7.7",
7
7
  "type": "module",
8
8
  "main": "dist/widget-gauge.js",
9
9
  "types": "dist/src/widget-gauge.d.ts",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "sections": {
13
13
  "sectionLimits": [-20, 80, 90, 120],
14
- "backgroundColors": ["#AAC8A7", "#F1C27B", "#FF9B9B"]
14
+ "backgroundColors": [null, null, null]
15
15
  },
16
16
  "advanced": {
17
17
  "averageLatest": 1
@@ -329,8 +329,8 @@ export class WidgetGauge extends LitElement {
329
329
  if (isNaN(ds.range as number)) ds.range = 100
330
330
  ds.ranges = ds.sections?.sectionLimits?.map((v, i, a) => v - (a?.[i - 1] ?? 0)).slice(1) ?? []
331
331
 
332
- // const option = this.canvasList.get(ds.label)?.echart.getOption()
333
- const option = window.structuredClone(this.template)
332
+ const echart = this.canvasList.get(ds.label)?.echart
333
+ const option = echart?.getOption() ?? window.structuredClone(this.template)
334
334
  const seriesArr = option.series as GaugeSeriesOption[]
335
335
  const ga: any = seriesArr?.[0],
336
336
  ga2: any = seriesArr?.[1]
@@ -395,7 +395,7 @@ export class WidgetGauge extends LitElement {
395
395
  titleElement.textContent = ds.label ?? ''
396
396
  }
397
397
 
398
- this.canvasList.get(ds.label)?.echart?.setOption(option)
398
+ echart?.setOption(option)
399
399
  }
400
400
  }
401
401
  deleteCharts() {