diff --git a/src/components/chart/state-history-chart-line.ts b/src/components/chart/state-history-chart-line.ts index 64e7feaa164b..e869ffadfe75 100644 --- a/src/components/chart/state-history-chart-line.ts +++ b/src/components/chart/state-history-chart-line.ts @@ -180,7 +180,9 @@ export class StateHistoryChartLine extends LitElement { return; } - const points = e.chart.getElementsAtEventForMode( + const chart = e.chart; + + const points = chart.getElementsAtEventForMode( e, "nearest", { intersect: true }, @@ -192,6 +194,7 @@ export class StateHistoryChartLine extends LitElement { fireEvent(this, "hass-more-info", { entityId: this._entityIds[firstPoint.datasetIndex], }); + chart.canvas.dispatchEvent(new Event("mouseout")); // to hide tooltip } }, }; diff --git a/src/components/chart/state-history-chart-timeline.ts b/src/components/chart/state-history-chart-timeline.ts index aa9123db2916..0330fcb1f811 100644 --- a/src/components/chart/state-history-chart-timeline.ts +++ b/src/components/chart/state-history-chart-timeline.ts @@ -238,6 +238,7 @@ export class StateHistoryChartTimeline extends LitElement { // @ts-ignore entityId: this._chartData?.datasets[index]?.label, }); + chart.canvas.dispatchEvent(new Event("mouseout")); // to hide tooltip }, }; } diff --git a/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts b/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts index 9e99c11ca75c..ea787919fffc 100644 --- a/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts +++ b/src/panels/lovelace/cards/energy/hui-energy-devices-graph-card.ts @@ -164,6 +164,7 @@ export class HuiEnergyDevicesGraphCard // @ts-ignore entityId: this._chartData?.datasets[0]?.data[index]?.y, }); + chart.canvas.dispatchEvent(new Event("mouseout")); // to hide tooltip }, }) );