* chore: Replace flot with highcharts Since flot hasn't been updated since 2014 and was only used in one place. Simplify how highcharts is initialized and used, and re-enable pre-bs5 export functionality. * Fix tests * Remove some console.log statements
63 lines
1.7 KiB
HTML
63 lines
1.7 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: 'Formal language'
|
|
}
|
|
},
|
|
yAxis: {
|
|
title: {
|
|
text: 'Number of {{ doc_label }}s'
|
|
}
|
|
},
|
|
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 tablesorter stats-data">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" data-sort="formal">Formal language</th>
|
|
<th scope="col" data-sort="percent">Percentage of {{ doc_label }}s</th>
|
|
<th scope="col" data-sort="count">{{ doc_label|capfirst }}s</th>
|
|
</tr>
|
|
</thead>
|
|
{% if table_data %}
|
|
<tbody>
|
|
{% for formal_language, percentage, count, names in table_data %}
|
|
<tr>
|
|
<td>{{ formal_language }}</td>
|
|
<td>{{ percentage|floatformat:2 }}%</td>
|
|
<td>{% include "stats/includes/number_with_details_cell.html" %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
{% endif %}
|
|
</table> |