mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 00:06:35 +00:00
Fix untracked energy rendering at the base of the bar stack (#24288)
This commit is contained in:
parent
4546c6f624
commit
cdd17eed2e
@ -327,17 +327,19 @@ export class HuiEnergyDevicesDetailGraphCard
|
|||||||
);
|
);
|
||||||
|
|
||||||
const untrackedConsumption: BarSeriesOption["data"] = [];
|
const untrackedConsumption: BarSeriesOption["data"] = [];
|
||||||
Object.keys(consumptionData.total).forEach((time) => {
|
Object.keys(consumptionData.total)
|
||||||
const ts = Number(time);
|
.sort((a, b) => Number(a) - Number(b))
|
||||||
const value =
|
.forEach((time) => {
|
||||||
consumptionData.total[time] - (totalDeviceConsumption[time] || 0);
|
const ts = Number(time);
|
||||||
const dataPoint: number[] = [ts, value];
|
const value =
|
||||||
if (compare) {
|
consumptionData.total[time] - (totalDeviceConsumption[time] || 0);
|
||||||
dataPoint[2] = dataPoint[0];
|
const dataPoint: number[] = [ts, value];
|
||||||
dataPoint[0] = compareTransform(new Date(ts)).getTime();
|
if (compare) {
|
||||||
}
|
dataPoint[2] = dataPoint[0];
|
||||||
untrackedConsumption.push(dataPoint);
|
dataPoint[0] = compareTransform(new Date(ts)).getTime();
|
||||||
});
|
}
|
||||||
|
untrackedConsumption.push(dataPoint);
|
||||||
|
});
|
||||||
// random id to always add untracked at the end
|
// random id to always add untracked at the end
|
||||||
const order = Date.now();
|
const order = Date.now();
|
||||||
const dataset: BarSeriesOption = {
|
const dataset: BarSeriesOption = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user