From 0ddcd77947416cdd8a15e2e114cf82ab56834795 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 19 Feb 2017 17:56:24 +0100 Subject: [PATCH 1/2] time axis bugfix compare --- rowers/interactiveplots.py | 15 ++++++++++----- rowers/templates/team_compare_select.html | 4 ---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 6789d0ce..bb14a201 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -1591,6 +1591,7 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', 'workoutid'] datadf = dataprep.getsmallrowdata_db(columns,ids=ids) + tseconds = datadf.ix[:,'time'] yparamname = axlabels[yparam] @@ -1604,13 +1605,17 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', - if xparam=='distance': - xaxmax = datadf['distance'].max() - xaxmin = datadf['distance'].min() - else: + + + if xparam != 'distance' and xparam != 'time' and xparam != 'cumdist': xaxmax = yaxmaxima[xparam] xaxmin = yaxminima[xparam] - + elif xparam == 'time': + xaxmax = tseconds.max() + xaxmin = tseconds.min() + else: + xaxmax = datadf['distance'].max() + xaxmin = datadf['distance'].min() x_axis_type = 'linear' y_axis_type = 'linear' diff --git a/rowers/templates/team_compare_select.html b/rowers/templates/team_compare_select.html index d855a82b..cee206f8 100644 --- a/rowers/templates/team_compare_select.html +++ b/rowers/templates/team_compare_select.html @@ -6,10 +6,6 @@ {% block content %} - -
From 65b2dbd8f7b2b5c4703d42ff2009d41eea91ee93 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 19 Feb 2017 18:02:46 +0100 Subject: [PATCH 2/2] pace y axis --- rowers/interactiveplots.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index bb14a201..ccc18ca7 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -1617,6 +1617,9 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', xaxmax = datadf['distance'].max() xaxmin = datadf['distance'].min() + yaxmin = yaxminima[yparam] + yaxmax = yaxmaxima[yparam] + x_axis_type = 'linear' y_axis_type = 'linear' @@ -1628,8 +1631,8 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', if yparam == 'pace': y_axis_type = 'datetime' - yaxmax = 90. - yaxmin = 150. + yaxmax = 90.*1e3 + yaxmin = 150.*1e3 if xparam == 'time': x_axis_type = 'datetime' @@ -1692,6 +1695,9 @@ def interactive_multiple_compare_chart(ids,xparam,yparam,plottype='line', xrange1 = Range1d(start=yaxminima[xparam],end=yaxmaxima[xparam]) plot.x_range = xrange1 + yrange1 = Range1d(start=yaxmin,end=yaxmax) + plot.y_range = yrange1 + if xparam == 'time': xrange1 = Range1d(start=xaxmin,end=xaxmax) plot.x_range = xrange1