From ac3796ec31f10a5a3ff19f88a65325048a609896 Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Mon, 3 Feb 2025 12:21:30 +0200 Subject: [PATCH] Fix chart height (#24028) --- src/components/chart/ha-chart-base.ts | 4 ++-- src/panels/lovelace/cards/hui-history-graph-card.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index 85a2e4a538..d5f3c867e4 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -439,7 +439,7 @@ export class HaChartBase extends LitElement { } private _getDefaultHeight() { - return Math.max(this.clientWidth / 2, 300); + return this.clientWidth / 2; } private _handleZoomReset() { @@ -469,7 +469,7 @@ export class HaChartBase extends LitElement { } .chart-container { position: relative; - max-height: var(--chart-max-height, 300px); + max-height: var(--chart-max-height, 350px); } .chart { width: 100%; diff --git a/src/panels/lovelace/cards/hui-history-graph-card.ts b/src/panels/lovelace/cards/hui-history-graph-card.ts index 53758b07a5..f03488ce53 100644 --- a/src/panels/lovelace/cards/hui-history-graph-card.ts +++ b/src/panels/lovelace/cards/hui-history-graph-card.ts @@ -259,6 +259,7 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
${this._error @@ -319,6 +320,9 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard { state-history-charts { height: 100%; } + .has-rows { + --chart-max-height: 100%; + } `; }