Updates chart markup

This commit is contained in:
Mouse Reeve
2021-10-04 10:53:22 -07:00
parent fa241b08e7
commit 37cd7e684c
3 changed files with 32 additions and 42 deletions

View File

@ -1,24 +1,19 @@
{% load i18n %}
<script>
const labels = [{% for label in registration_stats.labels %}"{{ label }}",{% endfor %}];
const data = {
labels: labels,
datasets: [{
label: '{% trans "Active this month" %}',
backgroundColor: 'rgb(75, 192, 192)',
borderColor: 'rgb(75, 192, 192)',
data: {{ register_stats.total }},
}]
};
const config = {
type: 'line',
data: data,
options: {}
};
var userStats = new Chart(
document.getElementById('user_stats'),
config
var registerStats = new Chart(
document.getElementById('register_stats'),
{
type: 'bar',
data: {
labels: [{% for label in register_stats.labels %}"{{ label }}",{% endfor %}],
datasets: [{
label: '{% trans "Registrations" %}',
backgroundColor: 'rgb(75, 192, 192)',
borderColor: 'rgb(75, 192, 192)',
data: {{ register_stats.total }},
}]
},
options: {}
}
);
</script>