In Django how display all of the values aftere the for loop is finished instead of displaying them one by one

Posted by Igor on Stack Overflow See other posts from Stack Overflow or by Igor
Published on 2010-12-25T03:41:03Z Indexed on 2010/12/25 3:54 UTC
Read the original article Hit count: 374

Filed under:
|

Hello,

In my django project in the view I call the last 6 values in the column and send them to the template. I then would like to pass into google charts api those 6 values and have a graph. At the moment for some reason I get 6 different graphs.

{% for foodbag in foodbags %}
<img src="http://chart.apis.google.com/chart?chxl=0:|0|1|2|3|4|5|6&chxr=2,0,0&chxs=0,1,676767,10.5,1,l,676767|2,676767,5.5,0,l,676767&chxt=x,y&chs=300x170&cht=bvg&chco=76A4FB&chd=t:{{foodbag.12}},0&chma=0,5|5,5&chdlp=t&chtt=Food+Bags"/>
{% endfor %}

I'm not sure how to replace string chd=t:{{foodbag.12}}, with the 6 values I am trying to extract from foodbags. I would really appreciate the help.

Thank you

© Stack Overflow or respective owner

Related posts about python

Related posts about django-views