From e50b658db7beb88fe7eb266e99d69fe6088fcba9 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 5 Feb 2025 15:16:33 +0100 Subject: [PATCH] Set min height for graphs, adjust margins (#24078) * Set min height for graphs, adjust margins * stats + header adjustments * set min to 200 --- src/components/chart/ha-chart-base.ts | 2 +- src/components/chart/state-history-charts.ts | 6 +++++- src/panels/lovelace/cards/hui-history-graph-card.ts | 4 +++- src/panels/lovelace/cards/hui-statistics-graph-card.ts | 9 ++++++++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/components/chart/ha-chart-base.ts b/src/components/chart/ha-chart-base.ts index 9c9e24c4c1..84d06e9e93 100644 --- a/src/components/chart/ha-chart-base.ts +++ b/src/components/chart/ha-chart-base.ts @@ -496,7 +496,7 @@ export class HaChartBase extends LitElement { } private _getDefaultHeight() { - return Math.max(this.clientWidth / 2, 300); + return Math.max(this.clientWidth / 2, 200); } private _handleZoomReset() { diff --git a/src/components/chart/state-history-charts.ts b/src/components/chart/state-history-charts.ts index 45c767cf04..8deb9694a7 100644 --- a/src/components/chart/state-history-charts.ts +++ b/src/components/chart/state-history-charts.ts @@ -157,7 +157,7 @@ export class StateHistoryCharts extends LitElement { > `; } - return html`
+ return html`
+ + ${this._config.title + ? html`

${this._config.title}

` + : nothing}