Private
Public Access
1
0

rough version of comparison

This commit is contained in:
Sander Roosendaal
2017-02-19 16:45:53 +01:00
parent e0b719da4e
commit 0f49402023
8 changed files with 171 additions and 95 deletions

View File

@@ -2036,7 +2036,7 @@ def team_comparison_select(request,
form = WorkoutMultipleCompareForm()
form.fields["workouts"].queryset = workouts
chartform = ChartParamChoiceForm()
chartform = ChartParamChoiceForm(initial={'teamid':theteam.id})
return render(request, 'team_compare_select.html',
{'workouts': workouts,
@@ -2067,15 +2067,25 @@ def multi_compare_view(request):
workouts = cd['workouts']
xparam = chartform.cleaned_data['xparam']
yparam = chartform.cleaned_data['yparam']
plottype = chartform.cleaned_data['plottype']
teamid = chartform.cleaned_data['teamid']
ids = [w.id for w in workouts]
labeldict = {
w.id: w.__unicode__() for w in workouts
}
res = interactive_multiple_compare_chart(ids,xparam,yparam,
promember=promember)
promember=promember,
plottype=plottype,
labeldict=labeldict)
script = res[0]
div = res[1]
return render(request,'multicompare.html',
{'interactiveplot':script,
'the_div':div,
'promember':promember,
'teamid':teamid,
})
else:
return HttpResponse("Form is not valid")