adding dates to cp chart title
This commit is contained in:
@@ -521,11 +521,11 @@ def cpdata(workouts, options):
|
||||
|
||||
|
||||
ids = [w.id for w in workouts]
|
||||
delta, cpvalue, avgpower,workouts = dataprep.fetchcp_new(r,workouts)
|
||||
delta, cpvalue, avgpower,workoutnames = dataprep.fetchcp_new(r,workouts)
|
||||
powerdf = pd.DataFrame({
|
||||
'Delta':delta,
|
||||
'CP':cpvalue,
|
||||
'workout':workouts,
|
||||
'workout':workoutnames,
|
||||
})
|
||||
|
||||
|
||||
@@ -540,8 +540,15 @@ def cpdata(workouts, options):
|
||||
rowername = r.user.first_name+" "+r.user.last_name
|
||||
|
||||
if len(powerdf) !=0 :
|
||||
datefirst = pd.Series(w.date for w in workouts).min()
|
||||
datelast = pd.Series(w.date for w in workouts).max()
|
||||
title = 'CP chart for {name}, from {d1} to {d2}'.format(
|
||||
name = rowername,
|
||||
d1 = datefirst,
|
||||
d2 = datelast,
|
||||
)
|
||||
res = interactive_otwcpchart(powerdf,promember=True,rowername=rowername,r=r,
|
||||
cpfit=cpfit)
|
||||
cpfit=cpfit,title=title)
|
||||
script = res[0]
|
||||
div = res[1]
|
||||
p1 = res[2]
|
||||
|
||||
Reference in New Issue
Block a user