mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const points = e.chart.getElementsAtEventForMode(
|
const chart = e.chart;
|
||||||
|
|
||||||
|
const points = chart.getElementsAtEventForMode(
|
||||||
e,
|
e,
|
||||||
"nearest",
|
"nearest",
|
||||||
{ intersect: true },
|
{ intersect: true },
|
||||||
@ -192,6 +194,7 @@ export class StateHistoryChartLine extends LitElement {
|
|||||||
fireEvent(this, "hass-more-info", {
|
fireEvent(this, "hass-more-info", {
|
||||||
entityId: this._entityIds[firstPoint.datasetIndex],
|
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
|
// @ts-ignore
|
||||||
entityId: this._chartData?.datasets[index]?.label,
|
entityId: this._chartData?.datasets[index]?.label,
|
||||||
});
|
});
|
||||||
|
chart.canvas.dispatchEvent(new Event("mouseout")); // to hide tooltip
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -164,6 +164,7 @@ export class HuiEnergyDevicesGraphCard
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
entityId: this._chartData?.datasets[0]?.data[index]?.y,
|
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