diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 4c6e75a9..0797271f 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -4070,7 +4070,8 @@ def interactive_streamchart(id=0, promember=0): return [script, div] -def instroke_interactive_chart(df,metric, workout, spm_min, spm_max): +def instroke_interactive_chart(df,metric, workout, spm_min, spm_max, + activeminutesmin, activeminutesmax): df_pos = (df+abs(df))/2. df_min = -(-df+abs(-df))/2. @@ -4157,7 +4158,20 @@ def instroke_interactive_chart(df,metric, workout, spm_min, spm_max): text_color='black', ) + s2 = 'Time: {activeminutesmin} - {activeminutesmax} min'.format( + activeminutesmin=activeminutesmin, + activeminutesmax=activeminutesmax + ) + + label2 = Label(x=50,y=400, x_units='screen', y_units='screen', + text=s2, + background_fill_alpha=0.7, + background_fill_color='white', + text_color='black', + ) + plot.add_layout(label) + plot.add_layout(label2) plot.varea('x', y1='high', y2='low',source=source,fill_color="lightgray",alpha=0.5) diff --git a/rowers/templates/instroke_interactive.html b/rowers/templates/instroke_interactive.html index 7679dd0b..7fd5972e 100644 --- a/rowers/templates/instroke_interactive.html +++ b/rowers/templates/instroke_interactive.html @@ -119,7 +119,7 @@ $( function() {

In Stroke Metrics

    -
  • +
  • {% csrf_token %} diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index 0ba1d350..4e203499 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -2946,7 +2946,7 @@ def instroke_chart_interactive(request, id=0): spm_max = form.cleaned_data['spm_max'] activeminutesmin = form.cleaned_data['activeminutesmin'] activeminutesmax = form.cleaned_data['activeminutesmax'] - + activesecondsmin = 60.*activeminutesmin activesecondsmax = 60.*activeminutesmax @@ -2955,12 +2955,16 @@ def instroke_chart_interactive(request, id=0): metric, spm_min=spm_min, spm_max=spm_max, + activeminutesmin=activeminutesmin, + activeminutesmax=activeminutesmax, ) script, div = instroke_interactive_chart( data, metric, w, spm_min, spm_max, + activeminutesmin, + activeminutesmax, ) # change to range spm_min to spm_max