Private
Public Access
1
0

added callouts tooltips to multi compare

This commit is contained in:
Sander Roosendaal
2017-02-23 15:24:39 +01:00
parent 393dc6bbf8
commit 44367c1270

View File

@@ -1604,10 +1604,6 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
if datadf.empty:
return ['','<p>No non-zero data in selection</p>','','']
if xparam != 'distance' and xparam != 'time' and xparam != 'cumdist':
xaxmax = yaxmaxima[xparam]
xaxmin = yaxminima[xparam]
@@ -1673,17 +1669,29 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
group
)
TIPS = OrderedDict([
('time','@ftime'),
('pace','@fpace'),
('hr','@hr'),
('spm','@spm{1.1}'),
('distance','@distance{5}'),
])
hover = plot.select(type=HoverTool)
hover.tooltips = TIPS
if labeldict:
legend=labeldict[id]
else:
legend=str(id)
if plottype=='line':
plot.line('x','y',source=source,color=color,legend=legend)
l1 = plot.line('x','y',source=source,color=color,legend=legend)
else:
plot.scatter('x','y',source=source,color=color,legend=legend,
l1 = plot.scatter('x','y',source=source,color=color,legend=legend,
fill_alpha=0.4,line_color=None)
plot.add_tools(HoverTool(renderers=[l1],tooltips=TIPS))
cntr += 1
plot.legend.location='bottom_right'