mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Hide tooltip after clicking on a chart to display more info (cosmetic change) (#18103)
This commit is contained in:
parent
e1a71fbfaa
commit
c106a0ac85
@ -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
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -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
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -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
|
||||
},
|
||||
})
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user