62 lines
1.7 KiB
HTML
62 lines
1.7 KiB
HTML
{% load origin %}
|
|
{% origin %}
|
|
<div id="chart"></div>
|
|
<script>
|
|
var chartConf = {
|
|
chart: {
|
|
type: 'line'
|
|
},
|
|
plotOptions: {
|
|
line: {
|
|
animation: false
|
|
}
|
|
},
|
|
title: {
|
|
text: '{{ stats_title|escapejs }}'
|
|
},
|
|
xAxis: {
|
|
title: {
|
|
text: 'Number of words'
|
|
}
|
|
},
|
|
yAxis: {
|
|
title: {
|
|
text: 'Number of {{ doc_label }}s'
|
|
}
|
|
},
|
|
tooltip: {
|
|
formatter: function () {
|
|
var s = '<b>' + this.x + ' - ' + (this.x + {{ bin_size }} - 1) + ' ' + (this.x == 1 ? "word" : 'words') + '</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="num">Words</th>
|
|
<th scope="col" data-sort="num">Percentage of {{ doc_label }}s</th>
|
|
<th scope="col" data-sort="num">{{ doc_label|capfirst }}s</th>
|
|
</tr>
|
|
</thead>
|
|
{% if table_data %}
|
|
<tbody>
|
|
{% for pages, percentage, count, names in table_data %}
|
|
<tr>
|
|
<td>{{ pages }}</td>
|
|
<td>{{ percentage|floatformat:2 }}%</td>
|
|
<td>{% include "stats/includes/number_with_details_cell.html" %}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
{% endif %}
|
|
</table> |