areski / django-nvd3

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

data_piechart_container is empty on upgrading to 0.7.6 from 0.7.4 #41

Closed lgp171188 closed 9 years ago

lgp171188 commented 9 years ago

I am using django-nvd3 in my Django application (https://github.com/lgp171188/xpens). I had not pinned down the version of django-nvd3 and hence the django-nvd3 package got updated to 0.7.6 and the charts that were previously working with 0.7.4 were no longer working.

I checked the JavaScript console for error messages and I found that data_piechart_container array in the JavaScript code was empty and hence the code which tried to access data_piechart_container[0] was causing an error and the chart didn't load. Pinning the version of django-nvd3 to 0.7.4 and reinstalling django-nvd3 and the corresponding dependency version of python-nvd3 fixed the problem. Not sure if it is in python-nvd3 or django-nvd3. So I am reporting this issue as a regression.

In case you want to see the usage of django-nvd3 in my project and check if it is okay, I can help with that. If there is something that has changed between 0.7.4 and 0.7.6 that I have missed doing while using django-nvd3, please let me know so that I can test and find out if that works for me.

jschaub30 commented 9 years ago

I saw the same error when I tried the piechart in 0.7.6. I never reverted to 0.7.4, but I ended up trying the lineChart example, which still worked.

I also tried downloading the demoproject, where the piechart seemed to work intermittently.

JovieMs commented 9 years ago

The following two lines have wrong intent in NVD3Chart.py: self.serie_no += 1 self.series.append(data_keyvalue) The fix is back-intent to outside " if extra "

areski commented 9 years ago

Thanks @jeffrl I released 0.7.7 which solve this issue.