first version of box chart (wash only)
This commit is contained in:
@@ -3834,7 +3834,7 @@ def workout_geeky_view(request,id=0,message="",successmessage=""):
|
||||
# Cumulative stats page
|
||||
@login_required()
|
||||
def cumstats(request,theuser=0,
|
||||
startdate=timezone.now()-datetime.timedelta(days=365),
|
||||
startdate=timezone.now()-datetime.timedelta(days=30),
|
||||
enddate=timezone.now(),
|
||||
deltadays=-1,
|
||||
startdatestring="",
|
||||
@@ -3957,6 +3957,12 @@ def cumstats(request,theuser=0,
|
||||
|
||||
ids = [int(workout.id) for workout in allergworkouts]
|
||||
|
||||
datemapping = {
|
||||
w.id:w.date for w in allergworkouts
|
||||
}
|
||||
|
||||
|
||||
|
||||
fieldlist,fielddict = dataprep.getstatsfields()
|
||||
|
||||
# prepare data frame
|
||||
@@ -3972,6 +3978,7 @@ def cumstats(request,theuser=0,
|
||||
# Create stats
|
||||
stats = {}
|
||||
fielddict.pop('workoutstate')
|
||||
fielddict.pop('workoutid')
|
||||
|
||||
for field,verbosename in fielddict.iteritems():
|
||||
thedict = {
|
||||
@@ -3998,8 +4005,13 @@ def cumstats(request,theuser=0,
|
||||
except KeyError:
|
||||
thedict[field2] = 0
|
||||
|
||||
cordict[field1] = thedict
|
||||
cordict[field1] = thedict
|
||||
|
||||
# interactive box plot
|
||||
datadf['workoutid'].replace(datemapping,inplace=True)
|
||||
datadf.rename(columns={"workoutid":"date"},inplace=True)
|
||||
script,div = interactive_boxchart(datadf,'wash')
|
||||
|
||||
# set options form correctly
|
||||
initial = {}
|
||||
initial['includereststrokes'] = includereststrokes
|
||||
@@ -4027,6 +4039,8 @@ def cumstats(request,theuser=0,
|
||||
'deltaform':deltaform,
|
||||
'optionsform':optionsform,
|
||||
'cordict':cordict,
|
||||
'plotscript':script,
|
||||
'plotdiv':div,
|
||||
})
|
||||
|
||||
request.session['options'] = options
|
||||
|
||||
Reference in New Issue
Block a user