mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Restore correct default legend behavior for history graph card (#14612)
fixes undefined
This commit is contained in:
parent
efda2ab626
commit
34e1d745be
@ -47,7 +47,7 @@ class StateHistoryChartLine extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public willUpdate(changedProps: PropertyValues) {
|
public willUpdate(changedProps: PropertyValues) {
|
||||||
if (!this.hasUpdated) {
|
if (!this.hasUpdated || changedProps.has("showNames")) {
|
||||||
this._chartOptions = {
|
this._chartOptions = {
|
||||||
parsing: false,
|
parsing: false,
|
||||||
animation: false,
|
animation: false,
|
||||||
|
@ -64,7 +64,11 @@ export class StateHistoryChartTimeline extends LitElement {
|
|||||||
this._generateData();
|
this._generateData();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changedProps.has("startTime") || changedProps.has("endTime")) {
|
if (
|
||||||
|
changedProps.has("startTime") ||
|
||||||
|
changedProps.has("endTime") ||
|
||||||
|
changedProps.has("showNames")
|
||||||
|
) {
|
||||||
this._createOptions();
|
this._createOptions();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,9 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
|
|||||||
.historyData=${this._stateHistory}
|
.historyData=${this._stateHistory}
|
||||||
.names=${this._names}
|
.names=${this._names}
|
||||||
up-to-now
|
up-to-now
|
||||||
.showNames=${this._config.show_names}
|
.showNames=${this._config.show_names !== undefined
|
||||||
|
? this._config.show_names
|
||||||
|
: true}
|
||||||
></state-history-charts>
|
></state-history-charts>
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user