fixed bug with disappearing div
This commit is contained in:
@@ -319,7 +319,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
|
||||
p.legend.location = "top_left"
|
||||
p.legend.background_fill_alpha = 0.7
|
||||
# p.sizing_mode = 'scale_width'
|
||||
#p.sizing_mode = 'scale_width'
|
||||
p.sizing_mode = 'stretch_both'
|
||||
|
||||
p.yaxis.axis_label = 'Minutes'
|
||||
@@ -3738,6 +3738,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
datadf.dropna(axis=1,how='all',inplace=True)
|
||||
datadf.dropna(axis=0,how='any',inplace=True)
|
||||
|
||||
|
||||
nrworkouts = len(ids)
|
||||
|
||||
try:
|
||||
@@ -3800,13 +3801,14 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
plot = Figure(x_axis_type=x_axis_type,y_axis_type=y_axis_type,
|
||||
tools=TOOLS,
|
||||
toolbar_location="above",
|
||||
plot_width=920,
|
||||
plot_width=920,plot_height=500,
|
||||
toolbar_sticky=False)
|
||||
|
||||
# add watermark
|
||||
plot.extra_y_ranges = {"watermark": watermarkrange}
|
||||
plot.extra_x_ranges = {"watermark": watermarkrange}
|
||||
plot.sizing_mode = 'stretch_both'
|
||||
plot.sizing_mode = 'scale_width'
|
||||
|
||||
|
||||
plot.image_url([watermarkurl],0.05,0.9,
|
||||
watermarkw,watermarkh,
|
||||
@@ -3826,6 +3828,8 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
|
||||
for id,color in itertools.izip(ids,colors):
|
||||
group = datadf[datadf['workoutid']==int(id)].copy()
|
||||
|
||||
|
||||
group.sort_values(by='time',ascending=True,inplace=True)
|
||||
try:
|
||||
group['x'] = group[xparam]
|
||||
@@ -3837,6 +3841,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
except KeyError:
|
||||
group['y'] = 0.0*group['x']
|
||||
|
||||
|
||||
ymean = group['y'].mean()
|
||||
ylabel = Label(x=100,y=60+nrworkouts*20-20*cntr,
|
||||
x_units='screen',y_units='screen',
|
||||
@@ -3909,8 +3914,6 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line',
|
||||
|
||||
script, div = components(plot)
|
||||
|
||||
|
||||
|
||||
return [script,div,message,errormessage]
|
||||
|
||||
|
||||
|
||||
@@ -14,12 +14,14 @@
|
||||
{{ interactiveplot |safe }}
|
||||
|
||||
<h1>Interactive Comparison</h1>
|
||||
|
||||
|
||||
<ul class="main-content">
|
||||
<li class="grid_4">
|
||||
|
||||
<div>
|
||||
{{ the_div|safe }}
|
||||
</div>
|
||||
|
||||
</li>
|
||||
<li class="grid_4">
|
||||
<form enctype="multipart/form-data" action="/rowers/multi-compare" method="post">
|
||||
|
||||
Reference in New Issue
Block a user