diff --git a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts index 543b8aec4f..44e4d6b613 100644 --- a/src/panels/lovelace/header-footer/hui-graph-header-footer.ts +++ b/src/panels/lovelace/header-footer/hui-graph-header-footer.ts @@ -193,13 +193,19 @@ export class HuiGraphHeaderFooter ? Math.max(width / 5, this._config.hours_to_show!) : this._config.hours_to_show! ); + const now = Date.now(); const useMean = this._config.detail !== 2; const { points } = coordinatesMinimalResponseCompressedState( entityHistory, width, width / 5, maxDetails, - { minY: this._config.limits?.min, maxY: this._config.limits?.max }, + { + minX: now - this._config.hours_to_show! * HOUR, + maxX: now, + minY: this._config.limits?.min, + maxY: this._config.limits?.max, + }, useMean ); this._coordinates = points;