mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Revert "Fix chart size in grid"
This reverts commit 8f1389de66fcc47fc3f5fe11bbb6b0bf04c7f1e6.
This commit is contained in:
parent
8f1389de66
commit
38bcdaa6f6
@ -244,8 +244,7 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
|
||||
})}`;
|
||||
|
||||
const columns = this._config.grid_options?.columns ?? 12;
|
||||
const narrow = typeof columns === "number" && columns <= 12;
|
||||
const hasFixedHeight = typeof this._config.grid_options?.rows === "number";
|
||||
const narrow = Number.isNaN(columns) || Number(columns) <= 12;
|
||||
|
||||
return html`
|
||||
<ha-card>
|
||||
@ -285,7 +284,9 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
|
||||
.minYAxis=${this._config.min_y_axis}
|
||||
.maxYAxis=${this._config.max_y_axis}
|
||||
.fitYData=${this._config.fit_y_data || false}
|
||||
.height=${hasFixedHeight ? "100%" : undefined}
|
||||
.height=${this._config.grid_options?.rows
|
||||
? "100%"
|
||||
: undefined}
|
||||
.narrow=${narrow}
|
||||
></state-history-charts>
|
||||
`}
|
||||
|
@ -258,8 +258,6 @@ export class HuiStatisticsGraphCard extends LitElement implements LovelaceCard {
|
||||
return nothing;
|
||||
}
|
||||
|
||||
const hasFixedHeight = typeof this._config.grid_options?.rows === "number";
|
||||
|
||||
return html`
|
||||
<ha-card .header=${this._config.title}>
|
||||
<div
|
||||
@ -292,7 +290,7 @@ export class HuiStatisticsGraphCard extends LitElement implements LovelaceCard {
|
||||
.daysToShow=${this._energyStart && this._energyEnd
|
||||
? differenceInDays(this._energyEnd, this._energyStart)
|
||||
: this._config.days_to_show || DEFAULT_DAYS_TO_SHOW}
|
||||
.height=${hasFixedHeight ? "100%" : undefined}
|
||||
.height=${this._config.grid_options?.rows ? "100%" : undefined}
|
||||
></statistics-chart>
|
||||
</div>
|
||||
</ha-card>
|
||||
|
Loading…
x
Reference in New Issue
Block a user