Python Bokeh Hover Tool Giving: Attributeerror: Unexpected Attribute 'tooltips' To Figure
How do I implement 'tooltips' for the hover tool in Bokeh 0.12.11 (and possibly other versions)? Searching for 'Bokeh hover tooltips' gives a bunch of documentation results such as
Solution 1:
Answer :
I removed the TOOLTIP= [] declaration, and the tooltips= parameter in the figure() object.
Make the Hover Tool programatically and attach to Figure:
from bokeh.models import HoverTool
{ some code }
p = figure(tools=TOOLS, title=TITLE, x_axis_label='Pressure (mTorr)', y_axis_label='Roughness (nm)')
hover = HoverTool()
hover.tooltips = [
("Sample", "@names"),
("Pressure", "@x_values mTorr"),
("Roughness", "@y_values nm"),
]
p.tools.append(hover)
As pointed out here: Python Bokeh HoverTool formatters error: "unexpected attribute 'formatters' to HoverTool"
version 0.12.11 supports it but I was having trouble implementing it.
Thanks to bigreddot for pointing out that passing that parameter only works in 0.13.
Post a Comment for "Python Bokeh Hover Tool Giving: Attributeerror: Unexpected Attribute 'tooltips' To Figure"