fixing active minutes
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ $( function() {
|
||||
|
||||
<h1>In Stroke Metrics</h1>
|
||||
<ul class="main-content">
|
||||
<li class="grid_4">
|
||||
<li class="grid_4" >
|
||||
<form id="instrokeform" enctype="multipart/form-data" action="" method="post">
|
||||
{% csrf_token %}
|
||||
<table>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user