Multi_line tooltips not working in bokeh version 2.2.1

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)

Thanks

@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).

2 Likes

Thanks @Bryan, looking forward to it.

@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)

1 Like

is downgrading a way to get the plots back to work? (at least until 2.3 comes out)

@foice Yea, you can do that. What I did was create a new environment using 1.3.4 to create these specific charts.

Ok, I will try if conda makes me the favor to downgrade to 2.2.0, or are you saying 1.3.4 is needed?

I would start with 2.1.x or 2.0.x before going all the way back to 1.3.4

2.1.0 works. 2.2.0, 2.2.1, work … 2.2.2 does not work.

2.1.0 works. 2.2.0, 2.2.1, work … 2.2.2 does not work

@foice there must be some confusion, the entire point of this thread is that multi line tooltips don’t work with 2.2.1

Multi_line tooltips not working in bokeh version 2.2.1

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.

I see, there may be some mess on env or something like that because when import bokeh I get

BokehJS 2.2.2 successfully loaded.

but also

from bokeh import __version__
gives me
__version__
‘2.2.1’

@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.

Done, here it is
https://discourse.bokeh.org/t/bokehjs-version-and-version-are-not-the-same/6609
I am quite puzzled, maybe I have up/downgraded too many times and coda is not doing it …