mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed tooltip does not change data when hovering over other datapoints (#54517)
This commit is contained in:
parent
f35a36b9f1
commit
d2bdb01092
@ -76,11 +76,15 @@ export const addTooltipSupport = ({
|
|||||||
const tooltipInterpolator = config.getTooltipInterpolator();
|
const tooltipInterpolator = config.getTooltipInterpolator();
|
||||||
if (tooltipInterpolator) {
|
if (tooltipInterpolator) {
|
||||||
config.addHook('setCursor', (u) => {
|
config.addHook('setCursor', (u) => {
|
||||||
|
if (isToolTipOpen.current) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
tooltipInterpolator(
|
tooltipInterpolator(
|
||||||
setFocusedSeriesIdx,
|
setFocusedSeriesIdx,
|
||||||
setFocusedPointIdx,
|
setFocusedPointIdx,
|
||||||
(clear) => {
|
(clear) => {
|
||||||
if (clear && !isToolTipOpen.current) {
|
if (clear) {
|
||||||
setCoords(null);
|
setCoords(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -90,7 +94,7 @@ export const addTooltipSupport = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const { x, y } = positionTooltip(u, rect);
|
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 } });
|
setCoords({ canvas: { x: u.cursor.left!, y: u.cursor.top! }, viewport: { x, y } });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user