diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 303e0cb0..655e7f37 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -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' @@ -3733,11 +3733,12 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', 'power','hr','spm', 'time','pace','workoutstate', 'workoutid'] - + datadf = dataprep.getsmallrowdata_db(columns,ids=ids) 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] diff --git a/rowers/templates/multicompare.html b/rowers/templates/multicompare.html index e3e32d7b..ae0fbe49 100644 --- a/rowers/templates/multicompare.html +++ b/rowers/templates/multicompare.html @@ -14,12 +14,14 @@ {{ interactiveplot |safe }}