Skip to content

Commit

Permalink
rearrange update calls
Browse files Browse the repository at this point in the history
  • Loading branch information
karwosts committed Oct 27, 2023
1 parent 6e75cd3 commit ab7fb45
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/chart/statistics-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit ab7fb45

Please sign in to comment.