Skip to content

Missing cursor coordinate and active tooltip state - ideally from a hook #6299

Description

@Appz-dk

Is your feature request related to a problem? Please describe.

I am trying to implement a very custom tooltip cursor component that synchronizes across multiple charts when hovering. And currently, there's no clean way to access the tooltip cursor's coordinates without resorting to hacky or awful performance solutions.

And I cannot simply pass a custom component to the tooltip cursor prop as this is not flexible enough for my use case.

Describe the solution you'd like

Please provide a hook (similar to existing useActiveTooltipDataPoints) that exposes:

  1. The current tooltip cursor x and y pixel coordinates
  2. The tooltip's active state (boolean)
  3. Any other useful data that others might need in the future

Or add this data to an already existing hook.

Describe alternatives you've considered

  1. Using the Tooltip cursor prop with a custom component - Not flexible enough for my use case
  2. Accessing the tooltip data via useActiveTooltipDataPoints - lacks actual coordinate information
  3. Stores the coordinate and active state from within the render props - Awful performance or infinite render loops
  4. Direct DOM manipulation using your coordinates from within the Tooltip cursor prop - can work but is brittle and not really the React way

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions