react-financial-charts icon indicating copy to clipboard operation
react-financial-charts copied to clipboard

Tooltip for bubblechart

Open gapetto opened this issue 4 years ago • 2 comments

I'm submitting a feature

Is it possible to create tooltip for bubble chart? If not, it would be good to add such functionality. I couldn't figure out how to do it. The goal is to create chart like here: https://finviz.com/bubbles.ashx.

gapetto avatar Jul 24 '21 10:07 gapetto

There's nothing out-of-the-box but it should be possible without too much work. The HoverTooltip is pretty close.

markmcdowell avatar Jul 26 '21 08:07 markmcdowell

Forking HoverTooltip won't be enough, I think changes have to be made to GenericComponent. Current implementation of this tooltip I think only works with xAccessor (?) which doesn't sound like it suits the case where the tooltip shows when hovering over the bubble which covers some area with radius.

UPDATE: the problem is that it's a canvas and there is no context provided of a circle to use for the tooltip. HoverTooltip requires only x coordinate, so that's easy, but here we need more and with canvas it's not provided. I'll check if it can be done maybe just with coordinates of current cursor position, measuring the distance to the point and comparing with the radius. But that sounds like it can be very slow with a lot of data points.

gapetto avatar Jul 26 '21 12:07 gapetto