useActiveTooltipCoordinate

Returns the Cartesian x + y coordinates of the active Tooltip.

Returns undefined if there is no active user interaction or if used outside a chart context.

Recharts only allows one Tooltip per chart, so this hook does not take any parameters. Weird things may happen if you have multiple Tooltip components in the same chart so please don't do that.

Available since Recharts 3.7

Return value

Coordinate | undefined

The coordinate of the active Tooltip, or undefined.