mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Hide legend for stats chart in more info, only shade area for min and… (#14273)
This commit is contained in:
parent
c810c67a53
commit
6f07e7ca59
@ -61,6 +61,8 @@ class StatisticsChart extends LitElement {
|
|||||||
|
|
||||||
@property() public chartType: ChartType = "line";
|
@property() public chartType: ChartType = "line";
|
||||||
|
|
||||||
|
@property({ type: Boolean }) public hideLegend = false;
|
||||||
|
|
||||||
@property({ type: Boolean }) public isLoadingData = false;
|
@property({ type: Boolean }) public isLoadingData = false;
|
||||||
|
|
||||||
@state() private _chartData: ChartData = { datasets: [] };
|
@state() private _chartData: ChartData = { datasets: [] };
|
||||||
@ -175,7 +177,7 @@ class StatisticsChart extends LitElement {
|
|||||||
propagate: true,
|
propagate: true,
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
display: true,
|
display: !this.hideLegend,
|
||||||
labels: {
|
labels: {
|
||||||
usePointStyle: true,
|
usePointStyle: true,
|
||||||
},
|
},
|
||||||
@ -339,7 +341,7 @@ class StatisticsChart extends LitElement {
|
|||||||
? "-1"
|
? "-1"
|
||||||
: false
|
: false
|
||||||
: false,
|
: false,
|
||||||
borderColor: band ? color + "7F" : color,
|
borderColor: band ? color + (this.hideLegend ? "00" : "7F") : color,
|
||||||
backgroundColor: band ? color + "3F" : color + "7F",
|
backgroundColor: band ? color + "3F" : color + "7F",
|
||||||
pointRadius: 0,
|
pointRadius: 0,
|
||||||
data: [],
|
data: [],
|
||||||
|
@ -65,6 +65,7 @@ export class MoreInfoHistory extends LitElement {
|
|||||||
.statisticsData=${this._statistics}
|
.statisticsData=${this._statistics}
|
||||||
.statTypes=${statTypes}
|
.statTypes=${statTypes}
|
||||||
.names=${this._statNames}
|
.names=${this._statNames}
|
||||||
|
hideLegend
|
||||||
></statistics-chart>`
|
></statistics-chart>`
|
||||||
: html`<state-history-charts
|
: html`<state-history-charts
|
||||||
up-to-now
|
up-to-now
|
||||||
|
Loading…
x
Reference in New Issue
Block a user