1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-17 15:45:43 +01:00

Don't include "null" data point in stat graph (#30058)

When displaying the "now" value on statistics graphs, don't include a "null" data point for sum/change type graphs, just skip entirely.

Otherwise for you get a messy null data point in the tooltip.
This commit is contained in:
Tom Carpenter
2026-03-09 07:02:00 +00:00
committed by GitHub
parent b62e6c9328
commit 5a2d7f100a

View File

@@ -640,11 +640,12 @@ export class StatisticsChart extends LitElement {
) {
// Then push the current state at now
statTypes.forEach((type, i) => {
const val: (number | null)[] = [];
if (type === "sum" || type === "change") {
// Skip cumulative types - need special calculation
val.push(null);
} else if (
// Skip cumulative types - need special calculation.
return;
}
const val: (number | null)[] = [];
if (
type === bandTop &&
this.chartType === "line" &&
drawBands &&