moviewyrm/bookwyrm/templates/settings/dashboard/user_chart.html
2021-10-04 11:14:50 -07:00

25 lines
744 B
HTML

{% load i18n %}
<script>
var userStats = new Chart(
document.getElementById('user_stats'),
{
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: {}
}
);
</script>