jquery迷你图的简单标记抽象
django-sparklines的Python项目详细描述
Django迷你图
这是jquery迷你图的简单模板标记抽象。简单图 对基本活动趋势有用。
http://omnipotent.net/jquery.sparkline/
这里是截图
http://www.ascetinteractive.com.au/images/django-sparkline.png
安装
- 设置.py
- “迷你图”,在已安装的应用程序中
{%加载迷你图标记%}
包括三个标签
{% sparklines_script_tag %}
<script src=’..jquery’> tags for the <head>{%迷你图列表[dict选项]]}
will take a list of integers有关选项,请参见http://omnipotent.net/jquery.sparkline/#common。
{%queryset_迷你图queryset date_字段[dict options,date start,date end,int step,str mode]]}
will take a queryset and model.date_field string and plot frequency of records. A simple example would be plotting auth.User by date_joined.
By default it will render frequency for the last 52 weeks.
示例: {%queryset\u迷你图用户的加入日期'%},其中用户是 user.objects.all()