Hi all,
I’m trying to show tooltip on my scatter plot, but I would like the tooltip to be shown or hidden with a click policy.
The best I could do was with HoverTool.
Here is a sample for testing:
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.plotting import figure, output_file, show
output_file(“tooltip.html”)
hover = HoverTool(tooltips=[
(“Name”, “@name”)])
p = figure(plot_width=400, plot_height=400,
tools=[hover], title=“Hover the Dots”)
source = ColumnDataSource(data=dict(
x=[1, 2, 3, 4, 5],
y=[2, 5, 8, 2, 7],
color=[“navy”, “orange”, “olive”, “firebrick”, “gold”],
name=[‘Paul’, ‘Peter’, ‘Sarah’, ‘John’, ‘Thomas’]
))
p.circle(‘x’, ‘y’, color=‘color’, size=20, source=source)
show(p)
``
Thank you for your time.
I’m not an expert but I am eager to learn more about Bokeh.
Viphone