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