How to show data only for currently hovered line series in a Multiseries Recharts chart?

31 Views Asked by At

Recharts default behavior is to show values for all series like in this picture: default behaivor of Recharts

What I would like to achieve is to show only data for lets say "pv" if my cursor is over blue line and blue dot.

I have sort of implemented it by using a state to set current active line which is set when hovering over a line, and then just filtering the payload that is passed to CustomTooltip component, but it is kinda laggy since you have to be precise on the dot.

Is there a smarter/easier way of doing this?

0

There are 0 best solutions below