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) {
|
||||
if (!this.hasUpdated) {
|
||||
if (!this.hasUpdated || changedProps.has("showNames")) {
|
||||
this._chartOptions = {
|
||||
parsing: false,
|
||||
animation: false,
|
||||
|
|
|
@ -64,7 +64,11 @@ export class StateHistoryChartTimeline extends LitElement {
|
|||
this._generateData();
|
||||
}
|
||||
|
||||
if (changedProps.has("startTime") || changedProps.has("endTime")) {
|
||||
if (
|
||||
changedProps.has("startTime") ||
|
||||
changedProps.has("endTime") ||
|
||||
changedProps.has("showNames")
|
||||
) {
|
||||
this._createOptions();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,7 +144,9 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
|
|||
.historyData=${this._stateHistory}
|
||||
.names=${this._names}
|
||||
up-to-now
|
||||
.showNames=${this._config.show_names}
|
||||
.showNames=${this._config.show_names !== undefined
|
||||
? this._config.show_names
|
||||
: true}
|
||||
></state-history-charts>
|
||||
</div>
|
||||
</ha-card>
|
||||
|
|
Loading…
Reference in New Issue