Fix chart height (#24028)

This commit is contained in:
Petar Petrov 2025-02-03 12:21:30 +02:00 committed by GitHub
parent 8c3fdfb6fb
commit ac3796ec31
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -439,7 +439,7 @@ export class HaChartBase extends LitElement {
} }
private _getDefaultHeight() { private _getDefaultHeight() {
return Math.max(this.clientWidth / 2, 300); return this.clientWidth / 2;
} }
private _handleZoomReset() { private _handleZoomReset() {
@ -469,7 +469,7 @@ export class HaChartBase extends LitElement {
} }
.chart-container { .chart-container {
position: relative; position: relative;
max-height: var(--chart-max-height, 300px); max-height: var(--chart-max-height, 350px);
} }
.chart { .chart {
width: 100%; width: 100%;

View File

@ -259,6 +259,7 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
<div <div
class="content ${classMap({ class="content ${classMap({
"has-header": !!this._config.title, "has-header": !!this._config.title,
"has-rows": !!this._config.grid_options?.rows,
})}" })}"
> >
${this._error ${this._error
@ -319,6 +320,9 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
state-history-charts { state-history-charts {
height: 100%; height: 100%;
} }
.has-rows {
--chart-max-height: 100%;
}
`; `;
} }