Looping to provide multiple lines in linechart (django-googlecharts)
- by mighty_bombero
Hi,
I'm trying to generate some charts using django-googlecharts. This works fine for rather static data but in one case I would like to render a different number of lines, based on a variable. I tried this:
{% chart %}
{% for line in line_data %}
{% chart-data line %}
{% endfor %}
{% chart-size "390x200" %}
{% chart-type "line" %}
{% chart-labels days %}
{% endchart %}
Line data is a list containing lists. The template code fails with "Caught an exception while rendering: max() arg is an empty sequence".
I guess the problem is that I try to loop over templatetags. What approach could be used here? Or am I completely missing something? Is this doable using inclusion tags?
Thanks for your help.