areski / django-nvd3

Django wrapper for nvd3 - It's time for beautiful charts
Other
416 stars 124 forks source link

Line chart example not working! - Getting 'Type Error' #24

Open prasadmc opened 10 years ago

prasadmc commented 10 years ago

I am using python 2.7, django 1.6.1, installed django-nvd3 using "pip install django-nvd3"

I am trying to setup the line chart example as mentioned in http://django-nvd3.readthedocs.org/en/latest/classes-doc/line-chart.html

However, I am getting Type Error... pls see the screenshot below. error

Pls help!

samesense commented 10 years ago

I got this error too. You have to fix the view and the template. You can reference the piechart example to see how this is done.

In the view, you need to add extra data like in the piechart. data = { 'charttype': charttype, 'chartdata': chartdata, 'extra': {'x_is_date': True, 'x_axis_format': "%d %b %Y %H"}, }

Then you fix the template to make it look like the piechart example. Change {% load_chart charttype chartdata "linechart_container" True "%d %b %Y %H" %} to {% load_chart charttype chartdata "linechart_container" extra %}

Now extra is iterated over, passing in x_is_date and x_axis_format.

prasadmc commented 10 years ago

@samesense Thanks for the comment. I got that error resolved.

However, I have a different error now :( error I tried copying the files to "mysite\polls\static" folder... but, even that didn't work. PS: I have copied all STATIC related variables from settings.py from the example

Pls help...

samesense commented 10 years ago

@prasadmc I had this issue too. In settings.py, you need to add bower apps for d3 and nv.d3. Then run manage.py collectstatic to populate static w/ d3 and nv.d3 files. My bower app section of settings looks like this:

BOWER_INSTALLED_APPS = ( 'jquery#1.9', 'underscore', 'd3#3.3.6', 'nvd3#1.1.12-beta', )

saposki commented 8 years ago

I am using python 2.7, django 1.9, installed django-nvd3 using "pip install django-nvd3" and followed all the instructions and i am still getting this error.

please help....

BjoernLaemmerzahl commented 8 years ago

I have the same problem here. StackedAreaChart however seems to work fine.

bossajie commented 4 years ago

how you solved this guys?