I used jupyter notebook to do a practice of visualization, then I followed the code on http://docs.bokeh.org/en/latest/docs/user_guide/tools.html#basic-tooltips
It works, so I tried to add the "Formatting Tooltip", like the below code.
I just only added the attribute 'formatters', but the error happened.
from bokeh.plotting import figure, ColumnDataSource
from bokeh.models import HoverTool
from bokeh.io import output_notebook, show
output_notebook()
source = ColumnDataSource(data=dict(
x=[1, 2, 3, 4, 5],
y=[2, 5, 8, 2, 7],
desc=['A', 'b', 'C', 'd', 'E'],
))
hover = HoverTool(
tooltips=[
("index", "$index"),
("(x,y)", "($x, $y)"),
("desc", "@desc"),
],
formatters={
'desc' : 'printf', # use 'datetime' formatter for 'date' field
# use default 'numeral' formatter for other fields
}
)
p = figure(plot_width=400, plot_height=400, tools=[hover],
title="Mouse over the dots")
p.circle('x', 'y', size=20, source=source)
the error message:
AttributeError: unexpected attribute 'formatters' to HoverTool, possible attributes are anchor, attachment, callback, js_callbacks, line_policy, mode, name, names, plot, point_policy, renderers, show_arrow, tags or tooltips