From ab7fb45ebcb7e23ee96811491fda08407d852034 Mon Sep 17 00:00:00 2001 From: karwosts Date: Fri, 27 Oct 2023 11:14:09 -0700 Subject: [PATCH] rearrange update calls --- src/components/chart/statistics-chart.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/chart/statistics-chart.ts b/src/components/chart/statistics-chart.ts index 3bdb72427cc2..89c6905eac5f 100644 --- a/src/components/chart/statistics-chart.ts +++ b/src/components/chart/statistics-chart.ts @@ -97,7 +97,8 @@ export class StatisticsChart extends LitElement { if ( !this.hasUpdated || changedProps.has("unit") || - (this.chartType === "bar" && changedProps.has("period")) + changedProps.has("period") || + changedProps.has("chartType") ) { this._createOptions(); } @@ -442,8 +443,8 @@ export class StatisticsChart extends LitElement { Array.prototype.push.apply(totalDataSets, statDataSets); }); - if (unit || this.chartType === "bar") { - this._createOptions(unit ?? undefined); + if (unit) { + this._createOptions(unit); } this._chartData = {