Your Django template would look like this:
data: [
{% for item in count %}
{ y: '{{ item.date|date:"Y" }}', a: '{{ item.count }}' }{% if not forloop.last %},{% endif %}
{% endfor %}
],
This is part of the JavaScript that produces the Morris chart. The above produces a line with y
and a
values from your items (year is formatted to have four digits and count is taken from the item directly).