Only Show Hover Tooltip For One Glyph In Python Bokeh
I want to have my hovertool, showing only when I hover above the diamonds. As you will see my plot contains diamonds and lines. tooltips = [('Year', '@x{0}'), ('Numbers', '@y{0}')]
Solution 1:
Remove tooltips from figure then:
diamonds = p.diamond(df3reset["Years"], df3reset["Numbers"], size=20, color="navy", alpha=0.5)
p.add_tools(HoverTool(tooltips=tooltips, renderers=[diamonds]))
Solution 2:
This can also be accomplished keeping tooltips as you currently have:
p = figure(..., tooltips=tooltips)
r = p.diamond(...)
# restrict to just one renderer
p.hover.renderers = [r]
Post a Comment for "Only Show Hover Tooltip For One Glyph In Python Bokeh"