Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2020-05-10 11:54:18 +02:00
parent d01c42af2e
commit 5a309d1ba3
2 changed files with 32 additions and 16 deletions

View File

@@ -4700,7 +4700,7 @@ def history_view(request,userid=0):
tscript,tdiv = interactive_workouttype_piechart(g_workouts)
totalmeters,totalhours, totalminutes, totalseconds = get_totals(g_workouts)
# meters, duration per workout type
wtypes = list(set([w.workouttype for w in g_workouts]))
@@ -4839,10 +4839,7 @@ def history_view_data(request,userid=0):
ignoreadvanced=True)
totalmeters,totalhours, totalminutes,totalseconds = get_totals(g_workouts)
totalminutes = "{totalminutes:02d}".format(totalminutes=totalminutes)
# meters, duration per workout type
wtypes = list(set([w.workouttype for w in g_workouts]))
@@ -4908,9 +4905,13 @@ def history_view_data(request,userid=0):
# interactive hr pie chart
if typeselect == 'All':
totalscript,totaldiv = interactive_hr_piechart(df,r,'All Workouts')
totalseconds = 3600*totalhours+60*totalminutes+totalseconds
totalscript,totaldiv = interactive_hr_piechart(df,r,'All Workouts',
totalseconds=totalseconds)
else:
a_workouts = g_workouts.filter(workouttype=typeselect)
hours,minutes,seconds = get_totals(a_workouts)
totalseconds = 3600*hours+60*minutes+seconds
ddf = getsmallrowdata_db(columns,ids=[w.id for w in a_workouts])
try:
ddf['deltat'] = ddf['time'].diff()
@@ -4918,7 +4919,9 @@ def history_view_data(request,userid=0):
pass
ddf = dataprep.clean_df_stats(ddf,workstrokesonly=True,
ignoreadvanced=True)
totalscript, totaldiv = interactive_hr_piechart(ddf,r,mytypes.workouttypes_ordered[typeselect])
totalscript, totaldiv = interactive_hr_piechart(
ddf,r,mytypes.workouttypes_ordered[typeselect],
totalseconds=totalseconds)
return JSONResponse({
'script':totalscript,