1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-02 00:27:49 +01:00

Remove duplicate final point in bar statistics-chart (#30175)

For bar charts, we don't need to close out the final segment. All this does is produce a duplicate final bar.
This commit is contained in:
Tom Carpenter
2026-03-17 06:25:23 +00:00
committed by GitHub
parent e2e5feb8d5
commit 147a21db27

View File

@@ -612,10 +612,10 @@ export class StatisticsChart extends LitElement {
}
});
// Close out the last stat segment at prevEndTime
// For line charts, close out the last stat segment at prevEndTime
const lastEndTime = prevEndTime;
const lastValues = prevValues;
if (lastEndTime && lastValues) {
if (this.chartType === "line" && lastEndTime && lastValues) {
statDataSets.forEach((d, i) => {
d.data!.push(
this._transformDataValue([lastEndTime, ...lastValues[i]!])