简体   繁体   中英

django-nvd3 dependency on django version

I am trying to use django-nvd3 with django. I copied the line chart example from http://django-nvd3.readthedocs.org/en/latest/classes-doc/line-chart.html . But it is not working. I am getting following error

"simple_tag() got an unexpected keyword argument 'name'"

I am guessing this is due to version incompatibility. I am using django version 1.3 and django-nvd3 version 0.6

The reason I am guessing version mismatch is that I had to modify the example template The example template had following line

<link media="all" href="{% static 'nvd3/src/nv.d3.css' %}" type="text/css" rel="stylesheet" />

Then I got "Invalid block tag: 'static'" error. I replaced the href as "/static/nvd3/src/nv.d3.css" and I got that error resolved.

Here is template file

{% load static %}
<link media="all" href="/static/nvd3/src/nv.d3.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src='/static/d3/d3.min.js'></script>
<script type="text/javascript" src='/static/nvd3/nv.d3.min.js'></script>

{% load nvd3_tags %}
<head>
    {% load_chart charttype chartdata "linechart_container" True "%d %b %Y %H" %}
</head>
<body>
    {% include_container "linechart_container" 400 600 %}
</body>

Pls help me get over the "simple_tag()...." error.

Try change

{% load_chart charttype chartdata "linechart_container" True "%d %b %Y %H" %}

to

{% load_chart charttype chartdata "linechart_container" kw_extra "%d %b %Y %H" %}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM