added title to box plot
This commit is contained in:
@@ -3032,7 +3032,10 @@ def boxplot_view(request,userid=0,
|
||||
|
||||
includereststrokes = options['includereststrokes']
|
||||
workstrokesonly = not includereststrokes
|
||||
|
||||
|
||||
if userid==0:
|
||||
userid = request.user.id
|
||||
|
||||
if request.method == 'POST' and 'workouts' in request.POST:
|
||||
form = WorkoutMultipleCompareForm(request.POST)
|
||||
chartform = BoxPlotChoiceForm(request.POST)
|
||||
@@ -3064,13 +3067,24 @@ def boxplot_view(request,userid=0,
|
||||
datadf['workoutid'].replace(datemapping,inplace=True)
|
||||
datadf.rename(columns={"workoutid":"date"},inplace=True)
|
||||
datadf = datadf.sort_values(['date'])
|
||||
script,div = interactive_boxchart(datadf,plotfield)
|
||||
|
||||
if userid == 0:
|
||||
extratitle = ''
|
||||
else:
|
||||
u = User.objects.get(id=userid)
|
||||
extratitle = ' '+u.first_name+' '+u.last_name
|
||||
|
||||
|
||||
|
||||
script,div = interactive_boxchart(datadf,plotfield,
|
||||
extratitle=extratitle)
|
||||
|
||||
|
||||
return render(request,'boxplot.html',
|
||||
{'interactiveplot':script,
|
||||
'the_div':div,
|
||||
'chartform':chartform,
|
||||
'userid':userid,
|
||||
'teams':get_my_teams(request.user),
|
||||
})
|
||||
else:
|
||||
@@ -3101,13 +3115,22 @@ def boxplot_view(request,userid=0,
|
||||
datadf['workoutid'].replace(datemapping,inplace=True)
|
||||
datadf.rename(columns={"workoutid":"date"},inplace=True)
|
||||
datadf = datadf.sort_values(['date'])
|
||||
script,div = interactive_boxchart(datadf,plotfield)
|
||||
|
||||
if userid == 0:
|
||||
extratitle = ''
|
||||
else:
|
||||
u = User.objects.get(id=userid)
|
||||
extratitle = ' '+u.first_name+' '+u.last_name
|
||||
|
||||
script,div = interactive_boxchart(datadf,plotfield,
|
||||
extratitle=extratitle)
|
||||
|
||||
|
||||
return render(request,'boxplot.html',
|
||||
{'interactiveplot':script,
|
||||
'the_div':div,
|
||||
'chartform':chartform,
|
||||
'userid':userid,
|
||||
'teams':get_my_teams(request.user),
|
||||
})
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user