☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Limit the Hover tooltip to display single tooltip on overlapping data

Community Support
DrAstro
DrAstro

Hello, I have the same situation and question as presented in this stack overflow: https://stackoverflow.com/questions/68513132/displaying-only-one-tooltip-when-using-the-hovertool-in-bokeh

Essentially when data is close together, I want to avoid showing the stack of tooltips and only display the nearest one. I have tried all the techniques that I have found that the link above also references to but none of them seem to work in Bokeh 3 anymore.

I currently have my own CustomHTML for the tool tip and is very similar to the example expressed in the stack overflow question.

Am I missing a new setting that might make this easier? Or is an approach like this still required?

Thanks for any help

⌁   Link to post
Jonas_Grave_Kristens
Jonas_Grave_Kristens

The solution you refer to on SO seems OK to me. I have sometimes used a setup with a regular CustomJS callback and a Label or Div element in a corner of a plot. The HoverTool callback gets the hovered indices as an array with cb_data.index.indices (scatter glyph). I can choose which index I want (if for some reason I want a specific). Then I update the text with the info I want to display.

⌁   Link to post

End of archived discussion · Replies are disabled