Open ghost opened 4 years ago
Is there a way to do this manually in the meantime?
The nearest computation could have a limit above which we don't show the tooltip(ref https://github.com/vega/vega-lite/issues/4262)
I agree that a nearest property for the tooltip would be helpful. Currently it can be hard to hit the exact pixel of e.g. a line chart corner to show the tooltip. Especially together with a distance limit (https://github.com/vega/vega-lite/issues/4262) and some sort of indication of which data point the tool tip belongs to (e.g. with a call out wedge/arrow) would make the tooltips easier to use. I think how this is handled in plotly is quite intuitive in terms of both the distance of activation and the little arrow pointing at the data point.
https://github.com/vega/vega-lite/assets/4560057/13ac4f90-1bee-4857-b53a-66a2ebd44b8d
It would help to have this feature implemented - currently there seems to be workarounds that can achieve this as per this discussion - https://github.com/vega/altair/discussions/3597. But it would be helpful to have this implemented directly
Suggestion
Add
nearest
property totooltip
:Motivation
I have enabled tooltips on a line chart. However, the tooltip only appears when you hover over an actual data point, rather than over the line itself. The data points in a line are very small and often far apart, so having something like
nearest
might make it easier to activate the tooltip.