Hide legend for stats chart in more info, only shade area for min and… (#14273)

This commit is contained in:
Bram Kragten 2022-11-05 18:33:43 +01:00 committed by GitHub
parent c810c67a53
commit 6f07e7ca59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -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: [] };
@ -175,7 +177,7 @@ class StatisticsChart extends LitElement {
propagate: true,
},
legend: {
display: true,
display: !this.hideLegend,
labels: {
usePointStyle: true,
},
@ -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: [],

View File

@ -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