@record-evolution/widget-linechart 1.6.7 → 1.6.8

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": "Webcomponent widget-linechart following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "widget-linechart",
6
- "version": "1.6.7",
6
+ "version": "1.6.8",
7
7
  "type": "module",
8
8
  "main": "dist/widget-linechart.js",
9
9
  "types": "dist/src/widget-linechart.d.ts",
@@ -184,6 +184,7 @@ export class WidgetLinechart extends LitElement {
184
184
  this.chartContainer = this.shadowRoot?.querySelector('.chart-container')
185
185
  this.transformData()
186
186
  this.applyData()
187
+ this.registerTheme(this.theme)
187
188
  // Add ResizeObserver for chart container
188
189
  if (this.chartContainer) {
189
190
  this.resizeObserver = new ResizeObserver(() => {
@@ -196,16 +197,16 @@ export class WidgetLinechart extends LitElement {
196
197
  }
197
198
 
198
199
  registerTheme(theme?: Theme) {
199
- if (!theme || !theme.theme_object || !theme.theme_name) return
200
-
201
- console.log('Registering theme', theme)
202
- echarts.registerTheme(theme.theme_name, theme.theme_object)
203
200
  const cssTextColor = getComputedStyle(this).getPropertyValue('--re-text-color').trim()
204
201
  const cssBgColor = getComputedStyle(this).getPropertyValue('--re-background-color').trim()
205
202
  this.themeBgColor = cssBgColor || this.theme?.theme_object?.backgroundColor
206
203
  this.themeTitleColor = cssTextColor || this.theme?.theme_object?.title?.textStyle?.color
207
204
  this.themeSubtitleColor =
208
205
  cssTextColor || this.theme?.theme_object?.title?.subtextStyle?.color || this.themeTitleColor
206
+
207
+ if (!theme || !theme.theme_object || !theme.theme_name) return
208
+
209
+ echarts.registerTheme(theme.theme_name, theme.theme_object)
209
210
  }
210
211
 
211
212
  transformData() {