Skip to main content

Python NVD3

Project description

Description:

Python-nvd3 is a wrapper for NVD3 graph library

nvd3:

for futher information on nvd3 : http://nvd3.org/

d3:

Data-Driven Documents http://d3js.org/

NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you.

Installation

Install, upgrade and uninstall python-nvd3.py with these commands:

#Install
$ sudo pip install python-nvd3

#Upgrade
$ sudo pip install --upgrade python-nvd3

#Uninstall
$ sudo pip uninstall python-nvd3

Or if you don’t have pip, use easy_install to install python-nvd3:

$ sudo easy_install python-nvd3

Usage

After installation use python-nvd3 as follow

import nvd3

#Open File to write the D3 Graph
output_file = open('test-nvd3.html', 'w')
output_file.write(nvd3.template_header_nvd3)

chart = nvd3.pieChart(name="pieChart", height=450, width=450)
#Create the keys
xdata = ["Orange", "Banana", "Pear", "Kiwi", "Apple", "Strawberry", "Pineapple"]
#Set a value for each key
ydata = [3, 4, 0, 1, 5, 7, 3]

#Add the serie
chart.add_serie(y=ydata, x=xdata)
chart.buildhtml()

output_file.write("<h2> pieChart Graph </h2>")
output_file.write(chart.htmlcontent)

#close Html file
output_file.close()

See the file examples.py for more samples.

Screenshot

https://raw.github.com/areski/python-nvd3/master/screenshot/screenshot-01.png

Supported graph

Currently implemented nvd3 chart:

  • lineWithFocusChart

  • lineChart

  • multiBarChart

  • pieChart

Documentation

Documentation is available on ‘Read the Docs’: http://python-nvd3.readthedocs.org

License

Python-nvd3 is licensed under MIT, see MIT-LICENSE.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python-nvd3-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file python-nvd3-0.1.1.tar.gz.

File metadata

File hashes

Hashes for python-nvd3-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cf847b25f22dccd1e964e9fc0a8beb9f71fb1167b7766e956aca48a9c51acf0f
MD5 2638bf0c2c3c49c79dc78b2ecb1ba0a9
BLAKE2b-256 864511a7d8660daaff4e97230ac431b3eab0f1ee3bf79a8411b2828d4ac462ae

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page