【问题标题】:Passing a list of numbers to google chart将数字列表传递给谷歌图表
【发布时间】:2011-01-04 12:39:42
【问题描述】:

我正在为 Django 使用 django-chart-tools[0] 应用程序。问题出在 chd 选项上,它需要一个数字列表:即 1,4,1,4,3,2,2... 但我有 app.2 是:[1,4,1,.. .]。有没有简单的方法解决这个问题。

{% chart %}

    http://chart.apis.google.com/chart

    ?chs=300x150

    &cht=ls

    &chco=FF0000

    &chd=t:{{ app.2 }} # app.2 is a list of numbers

    chm=B,EFEFEF,0,0,0

{% endchart %}

[0]http://pypi.python.org/pypi/django-chart-tools

感谢您的帮助。

【问题讨论】:

    标签: django-templates google-visualization


    【解决方案1】:

    对不起,新手问题,这就是我要找的:

    &chd=t:{{ app.2|join:',' }}
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-09
      • 1970-01-01
      • 2021-07-06
      相关资源
      最近更新 更多