From 9b8be9f1afe1f1930b87374586acb8ae9770171f Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Fri, 23 May 2025 13:08:22 +0300 Subject: [PATCH] Fix chart labels for multi year periods (#25572) --- src/components/chart/ha-chart-base.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index 0703d66eb9..597b5650fc 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -387,9 +387,9 @@ export class HaChartBase extends LitElement { if (axis.type !== "time" || axis.show === false) { return axis; } - if (axis.max && axis.min) { + if (axis.min) { this._minutesDifference = differenceInMinutes( - axis.max as Date, + (axis.max as Date) || new Date(), axis.min as Date ); }