☰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

How to add a hover event not hover tool to a Figure?

Community Support
dylanzxc
dylanzxc

Hi there,

I want to add a hover event to a figure. The design is when a user hovers(not clicks) his mouse at a button, a text message will show up. Can you give me a hint about which function should I use? I have read the API but didn’t find the supporting one.

Thank you.
Dylan

⌁   Link to post
Bryan
Bryan

There is no API except to add a HoverTool to a plot. It’s probably possible to directly manipulate the DOM to add a hover tooltip to a button, but I can’t do any more that suggest the possibility.

Also please note that the HTML standard document itself discourages tooltips on buttons on accessibility grounds:

Relying on the title attribute is currently discouraged as many user agents do not expose the attribute in an accessible manner as required by this specification (e.g., requiring a pointing device such as a mouse to cause a tooltip to appear, which excludes keyboard-only users and touch-only users, such as anyone with a modern phone or tablet).

⌁   Link to post
_jm
_jm

@dylanzxc

It is possible. You will need to think of things in terms of the grid layout concepts.

In this case, I think you wll want to not use the title of the figure but rather add a separate Div that has the title information "Sib Sp" in the example shown.

From there, you have several options to arrange things using rows, columns, or grids. See also the Spacer model depending on how you choose to arrange / group things.

⌁   Link to post
dylanzxc
dylanzxc

Thank you, I have moved the button aline with a title using the method you suggested.

But a problem happened is, I can feel the noticeable delay when I click the button, compared with putting the button on the top. Is this optimizable.

You can see the 1-2s delay from the following GIF.

⌁   Link to post

End of archived discussion · Replies are disabled