Adding hover tooltip on a Bar chart removes the other tools

this piece of code creates a bar chart, as you will see it contains a default toolbar with all the tools, resize, pan etc

import pandas as pd
from bokeh.charts import Bar
from bokeh.io import output_notebook, show
from bokeh.models import HoverTool
from bokeh.models.renderers import GlyphRenderer
output_notebook()
dict = {‘values’: {u’B’: 10, u’A’: 20}}
df = pd.DataFrame(dict)
df[‘labels’] = df.index
print df.sort(‘values’)
bar = Bar(df.sort(‘values’), values=‘values’,label=‘labels’)
show(bar)

now trying to add hover to this chart, it works fine with the below code, however all the tools resiize / pan / zoom, disappeared. where did I do a mistake ?

barhover = Bar(df, values=‘values’,label=‘labels’, tools=‘hover’)
glyph_renderers = barhover.select(GlyphRenderer)
bar_source = [glyph_renderers[i].data_source for i in range(len(glyph_renderers))]
hover = barhover.select(HoverTool)
for i in range(len(glyph_renderers)):
print(bar_source[i].data)
hover.tooltips = [
(‘labels’,’ @x’),
(‘value’, ‘@height’),
]
show(barhover)

answering my own question, I should RTFM…
http://bokeh.pydata.org/en/latest/docs/user_guide/tools.html
barhover = Bar(df, values=‘values’,label=‘labels’
, tools=‘pan, wheel_zoom,box_zoom,reset,resize,hover’)

···

On Monday, October 12, 2015 at 3:46:32 PM UTC+2, [email protected] wrote:

this piece of code creates a bar chart, as you will see it contains a default toolbar with all the tools, resize, pan etc

import pandas as pd
from bokeh.charts import Bar
from bokeh.io import output_notebook, show
from bokeh.models import HoverTool
from bokeh.models.renderers import GlyphRenderer
output_notebook()
dict = {‘values’: {u’B’: 10, u’A’: 20}}
df = pd.DataFrame(dict)
df[‘labels’] = df.index
print df.sort(‘values’)
bar = Bar(df.sort(‘values’), values=‘values’,label=‘labels’)
show(bar)

now trying to add hover to this chart, it works fine with the below code, however all the tools resiize / pan / zoom, disappeared. where did I do a mistake ?

barhover = Bar(df, values=‘values’,label=‘labels’, tools=‘hover’)
glyph_renderers = barhover.select(GlyphRenderer)
bar_source = [glyph_renderers[i].data_source for i in range(len(glyph_renderers))]
hover = barhover.select(HoverTool)
for i in range(len(glyph_renderers)):
print(bar_source[i].data)
hover.tooltips = [
(‘labels’,’ @x’),
(‘value’, ‘@height’),
]
show(barhover)