added callouts tooltips to multi compare
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user