mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Tweak the color of sum/change lines in statistics chart (#26242)
This commit is contained in:
parent
879e0ed3d5
commit
8e0ed288e1
@ -478,6 +478,8 @@ export class StatisticsChart extends LitElement {
|
|||||||
this.statTypes.includes("min") && statisticsHaveType(stats, "min");
|
this.statTypes.includes("min") && statisticsHaveType(stats, "min");
|
||||||
const drawBands = [hasMean, hasMax, hasMin].filter(Boolean).length > 1;
|
const drawBands = [hasMean, hasMax, hasMin].filter(Boolean).length > 1;
|
||||||
|
|
||||||
|
const hasState = this.statTypes.includes("state");
|
||||||
|
|
||||||
const bandTop = hasMax ? "max" : "mean";
|
const bandTop = hasMax ? "max" : "mean";
|
||||||
const bandBottom = hasMin ? "min" : "mean";
|
const bandBottom = hasMin ? "min" : "mean";
|
||||||
|
|
||||||
@ -499,7 +501,8 @@ export class StatisticsChart extends LitElement {
|
|||||||
const band = drawBands && (type === bandTop || type === bandBottom);
|
const band = drawBands && (type === bandTop || type === bandBottom);
|
||||||
statTypes.push(type);
|
statTypes.push(type);
|
||||||
const borderColor =
|
const borderColor =
|
||||||
band && hasMin && hasMax && hasMean
|
(band && hasMin && hasMax && hasMean) ||
|
||||||
|
(hasState && ["change", "sum"].includes(type))
|
||||||
? color + (this.hideLegend ? "00" : "7F")
|
? color + (this.hideLegend ? "00" : "7F")
|
||||||
: color;
|
: color;
|
||||||
const backgroundColor = band ? color + "3F" : color + "7F";
|
const backgroundColor = band ? color + "3F" : color + "7F";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user