1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-02 16:43:19 +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 Bram Kragten
parent 4548f9daae
commit 4f916abcbf

View File

@@ -613,10 +613,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]!])