Code Monkey home page Code Monkey logo

Comments (3)

toasty avatar toasty commented on August 16, 2024 1

This confused me too for a bit when trying to get a demo line chart to work.
Writing here in case it helps someone else who's equally new to all this.

The error I was getting from Django was the same 'map' object is not subscriptable referring to line 220 in my venv's lib/python3.4/site-packages/django_nvd3/templatetags/nvd3_tags.py but that was the symptom not the cause. As Renkai points out above the issue is a python2/3 compatibilty problem in the demo code (not in the nvd3 package), in my case xdata = map(lambda x: start_time + x * 1000000000, xdata) in the demo_linechart function.

Changing it and the similar line beneath to xdata = list(map(lambda x: start_time + x * 1000000000, xdata)) fixed it for me.

from django-nvd3.

Renkai avatar Renkai commented on August 16, 2024

Try to change xdata = map(lambda x: start_time + x * 1000000000, xdata) to xdata = list(map(lambda x: start_time + x * 1000000000, xdata)) and so on.

from django-nvd3.

GraphGrailAi avatar GraphGrailAi commented on August 16, 2024

The "list(" should be added in several such places.
Ando more: to get nvd3 working on Python 3.4.2 i changed nvd3_tags.py : unicode to str in 2 places.
Is it possible to make relevant versions to download via pip for Python 2.7 and Python 3 ?

from django-nvd3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.