added tooltip
This commit is contained in:
@@ -92,7 +92,7 @@ def interactive_boxchart(datadf,fieldname,extratitle=''):
|
|||||||
if datadf.empty:
|
if datadf.empty:
|
||||||
return '','It looks like there are no data matching your filter'
|
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',
|
plot = BoxPlot(datadf, values=fieldname, label='date',
|
||||||
legend=False,
|
legend=False,
|
||||||
@@ -141,6 +141,15 @@ def interactive_boxchart(datadf,fieldname,extratitle=''):
|
|||||||
|
|
||||||
plot.xaxis.major_label_orientation = pi/4
|
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)
|
script, div = components(plot)
|
||||||
|
|
||||||
return script,div
|
return script,div
|
||||||
|
|||||||
Reference in New Issue
Block a user