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:
|
if datadf.empty:
|
||||||
return ['','<p>No non-zero data in selection</p>','','']
|
return ['','<p>No non-zero data in selection</p>','','']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if xparam != 'distance' and xparam != 'time' and xparam != 'cumdist':
|
if xparam != 'distance' and xparam != 'time' and xparam != 'cumdist':
|
||||||
xaxmax = yaxmaxima[xparam]
|
xaxmax = yaxmaxima[xparam]
|
||||||
xaxmin = yaxminima[xparam]
|
xaxmin = yaxminima[xparam]
|
||||||
@@ -1673,17 +1669,29 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
|||||||
group
|
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:
|
if labeldict:
|
||||||
legend=labeldict[id]
|
legend=labeldict[id]
|
||||||
else:
|
else:
|
||||||
legend=str(id)
|
legend=str(id)
|
||||||
|
|
||||||
if plottype=='line':
|
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:
|
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)
|
fill_alpha=0.4,line_color=None)
|
||||||
|
|
||||||
|
plot.add_tools(HoverTool(renderers=[l1],tooltips=TIPS))
|
||||||
cntr += 1
|
cntr += 1
|
||||||
|
|
||||||
plot.legend.location='bottom_right'
|
plot.legend.location='bottom_right'
|
||||||
|
|||||||
Reference in New Issue
Block a user