Private
Public Access
1
0

added tooltip

This commit is contained in:
Sander Roosendaal
2017-05-16 17:31:04 +02:00
parent 4658e241a4
commit e04800db2f

View File

@@ -92,7 +92,7 @@ def interactive_boxchart(datadf,fieldname,extratitle=''):
if datadf.empty:
return '','It looks like there are no data matching your filter'
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,resize'
TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,resize,hover'
plot = BoxPlot(datadf, values=fieldname, label='date',
legend=False,
@@ -141,6 +141,15 @@ def interactive_boxchart(datadf,fieldname,extratitle=''):
plot.xaxis.major_label_orientation = pi/4
hover = plot.select(dict(type=HoverTool))
hover.tooltips = OrderedDict([
('Value','@y'),
('Date','@x'),
])
hover.mode = 'mouse'
script, div = components(plot)
return script,div