File tree 4 files changed +22
-0
lines changed
4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -440,6 +440,9 @@ views:
440
440
unit : Mbits/s
441
441
min : 0
442
442
max : 1000
443
+ group_by :
444
+ func : max
445
+ duration : 30min
443
446
- type : custom:apexcharts-card
444
447
chart_type : pie
445
448
header :
Original file line number Diff line number Diff line change @@ -384,6 +384,13 @@ class ChartsCard extends LitElement {
384
384
}
385
385
this . _graphs = this . _config . series . map ( ( serie , index ) => {
386
386
serie . index = index ;
387
+ serie . ignore_history = ! ! (
388
+ this . _config ?. chart_type &&
389
+ [ 'donut' , 'pie' , 'radialBar' ] . includes ( this . _config ?. chart_type ) &&
390
+ ( ! serie . group_by || serie . group_by ?. func === 'raw' ) &&
391
+ ! serie . data_generator &&
392
+ ! serie . offset
393
+ ) ;
387
394
if ( ! this . _headerColors [ index ] ) {
388
395
this . _headerColors [ index ] = defColors [ index % defColors . length ] ;
389
396
}
Original file line number Diff line number Diff line change @@ -183,6 +183,17 @@ export default class GraphEntry {
183
183
}
184
184
if ( ! this . _entityState || this . _updating ) return false ;
185
185
this . _updating = true ;
186
+
187
+ if ( this . _config . ignore_history ) {
188
+ let currentState : null | number | string = this . _entityState . state ;
189
+ if ( this . _config . transform ) {
190
+ currentState = this . _applyTransform ( currentState , this . _entityState ) ;
191
+ }
192
+ this . _computedHistory = [ [ new Date ( this . _entityState . last_updated ) . getTime ( ) , Number ( currentState ) ] ] ;
193
+ this . _updating = false ;
194
+ return true ;
195
+ }
196
+
186
197
let history : EntityEntryCache | undefined = undefined ;
187
198
188
199
if ( this . _config . data_generator ) {
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ export interface ChartCardSeriesConfig extends ChartCardSeriesExternalConfig {
28
28
start_with_last ?: boolean ;
29
29
} ;
30
30
show : ChartCardSeriesShowConfig ;
31
+ ignore_history : boolean ;
31
32
}
32
33
33
34
export interface ChartCardSeriesShowConfig extends ChartCardSeriesShowConfigExt {
You can’t perform that action at this time.
0 commit comments