Fixed tooltip does not change data when hovering over other datapoints (#54517) (#54595)

(cherry picked from commit d2bdb01092)

Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-09-01 12:10:53 -04:00
committed by GitHub
co-authored by Victor Marin
parent 019a200107
commit 11ba65420d
@@ -76,11 +76,15 @@ export const addTooltipSupport = ({
const tooltipInterpolator = config.getTooltipInterpolator();
if (tooltipInterpolator) {
config.addHook('setCursor', (u) => {
if (isToolTipOpen.current) {
return;
}
tooltipInterpolator(
setFocusedSeriesIdx,
setFocusedPointIdx,
(clear) => {
if (clear && !isToolTipOpen.current) {
if (clear) {
setCoords(null);
return;
}
@@ -90,7 +94,7 @@ export const addTooltipSupport = ({
}
const { x, y } = positionTooltip(u, rect);
if (x !== undefined && y !== undefined && !isToolTipOpen.current) {
if (x !== undefined && y !== undefined) {
setCoords({ canvas: { x: u.cursor.left!, y: u.cursor.top! }, viewport: { x, y } });
}
},