diff --git a/rowers/forms.py b/rowers/forms.py index 3763b132..1ec60254 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -321,11 +321,18 @@ grouplabels['workoutid'] = 'Workout' grouplabels.pop('None') grouplabels.pop('time') groupchoices = list(sorted(grouplabels.items(), key = lambda x:x[1])) +formaxlabelsmultiflex = formaxlabels.copy() +formaxlabelsmultiflex.pop('time') +formaxlabelsmultiflex.pop('distance') +parchoicesmultiflex = list(sorted(formaxlabelsmultiflex.items(), key = lambda x:x[1])) + class MultiFlexChoiceForm(forms.Form): - xparam = forms.ChoiceField(choices=parchoices,initial='spm', + xparam = forms.ChoiceField(choices=parchoicesmultiflex, + initial='spm', label='X axis') - yparam = forms.ChoiceField(choices=parchoices,initial='power', + yparam = forms.ChoiceField(choices=parchoicesmultiflex, + initial='power', label='Y axis') groupby = forms.ChoiceField(choices=groupchoices,initial='date', label='Group By') diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 59291631..a22d525c 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -1173,9 +1173,14 @@ def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', xparamname = axlabels[xparam] yparamname = axlabels[yparam] + if xparam=='distance': - xaxmax = datadf['x'].max() - xaxmin = datadf['x'].min() + xaxmax = datadf[xparam].max() + xaxmin = datadf[xparam].min() + elif xparam=='time': + tseconds = datadf.ix[:,'time'] + xaxmax = tseconds.max() + xaxmin = 0 else: xaxmax = yaxmaxima[xparam] xaxmin = yaxminima[xparam] diff --git a/rowers/templates/analysis.html b/rowers/templates/analysis.html index 2aeca53a..88cae736 100644 --- a/rowers/templates/analysis.html +++ b/rowers/templates/analysis.html @@ -110,9 +110,9 @@
{% if user.rower.rowerplan == 'pro' or user.rower.rowerplan == 'coach' %} - Multi Flex + Trend Flex {% else %} - Multi Flex + Trend Flex {% endif %}