mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Question stats: Show percentage
This commit is contained in:
@@ -563,7 +563,11 @@ class QuestionView(EventPermissionRequiredMixin, QuestionMixin, ChartContainingV
|
||||
a['alink'] = a['answer']
|
||||
a['answer'] = Country(a['answer']).name or a['answer']
|
||||
|
||||
return list(qs)
|
||||
r = list(qs)
|
||||
total = sum(a['count'] for a in r)
|
||||
for a in r:
|
||||
a['percentage'] = a['count'] / total * 100.
|
||||
return r
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data()
|
||||
|
||||
Reference in New Issue
Block a user