Skip to content

Commit

Permalink
Hide legend for stats chart in more info, only shade area for min and… (
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Nov 5, 2022
1 parent c810c67 commit 6f07e7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/chart/statistics-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class StatisticsChart extends LitElement {

@property() public chartType: ChartType = "line";

@property({ type: Boolean }) public hideLegend = false;

@property({ type: Boolean }) public isLoadingData = false;

@state() private _chartData: ChartData = { datasets: [] };
Expand Down Expand Up @@ -175,7 +177,7 @@ class StatisticsChart extends LitElement {
propagate: true,
},
legend: {
display: true,
display: !this.hideLegend,
labels: {
usePointStyle: true,
},
Expand Down Expand Up @@ -339,7 +341,7 @@ class StatisticsChart extends LitElement {
? "-1"
: false
: false,
borderColor: band ? color + "7F" : color,
borderColor: band ? color + (this.hideLegend ? "00" : "7F") : color,
backgroundColor: band ? color + "3F" : color + "7F",
pointRadius: 0,
data: [],
Expand Down
1 change: 1 addition & 0 deletions src/dialogs/more-info/ha-more-info-history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export class MoreInfoHistory extends LitElement {
.statisticsData=${this._statistics}
.statTypes=${statTypes}
.names=${this._statNames}
hideLegend
></statistics-chart>`
: html`<state-history-charts
up-to-now
Expand Down

0 comments on commit 6f07e7c

Please sign in to comment.