list_workouts improv
This commit is contained in:
@@ -254,6 +254,7 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
dates.append(dd)
|
||||
dates_sorting.append(dd2)
|
||||
durations.append(du)
|
||||
|
||||
types.append(w.workouttype)
|
||||
try:
|
||||
rowers.append(w.user.user.first_name[0]+w.user.user.last_name[0])
|
||||
@@ -272,13 +273,17 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
|
||||
# add dates with no activity
|
||||
while d<=enddate:
|
||||
dd = d.strftime('%d')
|
||||
dates.append(d.strftime('%m/%d'))
|
||||
|
||||
|
||||
dates_sorting.append(d.strftime('%Y/%m/%d'))
|
||||
durations.append(0)
|
||||
types.append('rower')
|
||||
rowers.append('Sander')
|
||||
d += datetime.timedelta(days=1)
|
||||
|
||||
|
||||
|
||||
df = pd.DataFrame({
|
||||
'date':dates,
|
||||
'date_sorting':dates_sorting,
|
||||
@@ -288,7 +293,8 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
||||
})
|
||||
|
||||
df.sort_values('date_sorting',inplace=True)
|
||||
|
||||
|
||||
|
||||
p = Bar(df,values='duration',
|
||||
label = CatAttr(columns=['date'], sort=False),
|
||||
xlabel='Date',
|
||||
|
||||
Reference in New Issue
Block a user