From 0ddcd77947416cdd8a15e2e114cf82ab56834795 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 19 Feb 2017 17:56:24 +0100 Subject: [PATCH] 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 %} - -