File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -307,16 +307,15 @@ export class PlotlyGraph extends HTMLElement {
307307 if ( ( entity as any ) . autoPeriod ) {
308308 if ( isEntityIdStatisticsConfig ( entity ) && entity . autoPeriod ) {
309309 const spanInMinutes = ( range [ 1 ] - range [ 0 ] ) / 1000 / 60 ;
310- const MIN_POINTS_PER_RANGE = 500 ;
310+ const MIN_POINTS_PER_RANGE = 100 ;
311+ let period : StatisticPeriod = "5minute" ;
311312 const period2minutes : [ StatisticPeriod , number ] [ ] = [
312313 // needs to be sorted in ascending order
313- [ "5minute" , 5 ] ,
314314 [ "hour" , 60 ] ,
315315 [ "day" , 60 * 24 ] ,
316316 // ["week", 60 * 24 * 7], not supported yet in HA
317317 [ "month" , 60 * 24 * 30 ] ,
318318 ] ;
319- let period = period2minutes [ 0 ] [ 0 ] ;
320319 for ( const [ aPeriod , minutesPerPoint ] of period2minutes ) {
321320 const pointsInSpan = spanInMinutes / minutesPerPoint ;
322321 if ( pointsInSpan > MIN_POINTS_PER_RANGE ) period = aPeriod ;
You can’t perform that action at this time.
0 commit comments