I updated to bokeh version 2.2.1 from version 1.3.4 and now I do not see any tooltip boxes when I hover over lines in a multi_line bokeh chart. I think my code is okay, it’s the same exact code I was using in version 1.3.4 where the tooltips did appear when I hovered over the lines.
Does anyone know if this is a bug or if this is a work around to do show tooltips on multi_line bokeh charts?
Here is the .py code so anyone can replicate the issue.
from bokeh.plotting import figure, output_file, show
from bokeh.models import ColumnDataSource
import pandas as pd
df = pd.DataFrame()
df['fruit'] = pd.Series([i*2 for i in range(0,10)])
df['vegetable'] = pd.Series([i*3 for i in range(0,10)])
dates = pd.to_datetime(
list(pd.date_range(start="2009-11-04", end="2009-11-13")))
lst = [df[i].tolist() for i in df.columns]
cds = ColumnDataSource(data=dict(
x = [dates] * 2, y = lst,
food_type = list(df.columns)))
tooltips = [("FoodType", "@food_type")]
#figure
p = figure(tooltips = tooltips, x_axis_type = 'datetime')
# glyph
p.multi_line('x','y', color = 'black',
hover_line_color = 'red',
hover_line_width = 1,
source = cds)
output_file("food_harvest.html")
show(p)
@rodrigo Your code is broken for me with 2.2.1 but works correctly with the latest development build. It seems this was a bug that was recently fixed (and will be in the next release).
@Bryan I see that version 2.2.2 was released earlier, and now it 2.2.3 a couple days ago.
I tried it on 2.2.2 but I don’t see tooltips when hovering, are you encountering the same?
The patch releases only included some major bugs that needed immediate fixing. Everything else will go in the next standard minor release 2.3 which should be out in the next month. (Neither 2.2.2 nor 2.2.3 were planned at the time I wrote above)
If you have some reproducible example that stopped working between 2.2.1 and 2.2.2 then I would suggest opening a new separate topic (with those details) to avoid further muddying this one.
@foice please open a new topic with some screen shots and platform, version info, etc. I don’t see how both of those things can happen in the same notebook.