moviewyrm/bookwyrm/templates/settings/dashboard/user_chart.html

26 lines
744 B
HTML
Raw Normal View History

2021-09-11 14:09:05 +00:00
{% load i18n %}
<script>
var userStats = new Chart(
document.getElementById('user_stats'),
2021-10-04 18:14:50 +00:00
{
type: 'line',
data: {
labels: [{% for label in user_stats.labels %}"{{ label }}",{% endfor %}],
datasets: [{
label: '{% trans "Total" %}',
backgroundColor: 'hsl(217, 71%, 53%)',
borderColor: 'hsl(217, 71%, 53%)',
data: {{ user_stats.total }},
}, {
label: '{% trans "Active this month" %}',
backgroundColor: 'hsl(171, 100%, 41%)',
borderColor: 'hsl(171, 100%, 41%)',
data: {{ user_stats.active }},
}]
},
options: {}
}
2021-09-11 14:09:05 +00:00
);
</script>