61 lines
1.6 KiB
HTML
61 lines
1.6 KiB
HTML
{% load origin %}
|
|
{% origin %}
|
|
<div id="chart"></div>
|
|
<script>
|
|
var chartConf = {
|
|
chart: {
|
|
type: 'column'
|
|
},
|
|
plotOptions: {
|
|
column: {
|
|
animation: false
|
|
}
|
|
},
|
|
title: {
|
|
text: '{{ stats_title|escapejs }}'
|
|
},
|
|
xAxis: {
|
|
type: "category",
|
|
title: {
|
|
text: 'Continent'
|
|
}
|
|
},
|
|
yAxis: {
|
|
title: {
|
|
text: 'Number of attendees'
|
|
}
|
|
},
|
|
tooltip: {
|
|
formatter: function () {
|
|
var s = '<b>' + this.points[0].key + '</b>';
|
|
|
|
$.each(this.points, function () {
|
|
s += '<br>' + chartConf.yAxis.title.text + ': ' + this.y;
|
|
});
|
|
|
|
return s;
|
|
},
|
|
shared: true
|
|
},
|
|
series: {{ chart_data }}
|
|
};
|
|
</script>
|
|
<h2>Data</h2>
|
|
<table class="table table-sm table-striped stats-data tablesorter">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" data-sort="continent">Continent</th>
|
|
<th scope="col" data-sort="num">Percentage of attendees</th>
|
|
<th scope="col" data-sort="num">Attendees</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for continent, percentage, count, names in table_data %}
|
|
<tr>
|
|
<td>{{ continent|default:"(unknown)" }}</td>
|
|
<td>{{ percentage|floatformat:2 }}%</td>
|
|
<td>{% include "stats/includes/number_with_details_cell.html" %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table> |