File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 3232
3333 render (
3434 html `
35- < widget-linechart-1 .6.6 .theme ="${ theme } " .inputData =${ data } >
35+ < widget-linechart-1 .6.7 .theme ="${ theme } " .inputData =${ data } >
3636 web component is not registered. Make sure to use the tag with the correct version
3737 string from the package.json
38- </ widget-linechart-1 .6.6 >
38+ </ widget-linechart-1 .6.7 >
3939 ` ,
4040 document . querySelector ( '#demo' )
4141 )
Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ export class WidgetLinechart extends LitElement {
184184 this . chartContainer = this . shadowRoot ?. querySelector ( '.chart-container' )
185185 this . transformData ( )
186186 this . applyData ( )
187+ this . registerTheme ( this . theme )
187188 // Add ResizeObserver for chart container
188189 if ( this . chartContainer ) {
189190 this . resizeObserver = new ResizeObserver ( ( ) => {
@@ -196,16 +197,16 @@ export class WidgetLinechart extends LitElement {
196197 }
197198
198199 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 )
203200 const cssTextColor = getComputedStyle ( this ) . getPropertyValue ( '--re-text-color' ) . trim ( )
204201 const cssBgColor = getComputedStyle ( this ) . getPropertyValue ( '--re-background-color' ) . trim ( )
205202 this . themeBgColor = cssBgColor || this . theme ?. theme_object ?. backgroundColor
206203 this . themeTitleColor = cssTextColor || this . theme ?. theme_object ?. title ?. textStyle ?. color
207204 this . themeSubtitleColor =
208205 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 )
209210 }
210211
211212 transformData ( ) {
You can’t perform that action at this time.
0 commit comments