From 4cdd59c0cfc9b794501471eabd127c17f6ceed59 Mon Sep 17 00:00:00 2001 From: Areski Belaid Date: Wed, 1 Jan 2014 15:05:28 +0100 Subject: [PATCH] update documentation --- MIT-LICENSE.txt | 2 +- docs/source/conf.py | 6 +- docs/source/includes/introduction.txt | 94 +++++++++++++++++++++++---- 3 files changed, 84 insertions(+), 18 deletions(-) diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt index 76e5b5c..2c55280 100644 --- a/MIT-LICENSE.txt +++ b/MIT-LICENSE.txt @@ -2,7 +2,7 @@ The MIT License (MIT) Django-nvd3 -Copyright (c) 2013 Arezqui Belaid and other contributors +Copyright (c) 2013-2014 Arezqui Belaid and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/docs/source/conf.py b/docs/source/conf.py index b132bf3..746a8e1 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -41,16 +41,16 @@ # General information about the project. project = u'django-nvd3' -copyright = u'2013, Arezqui Belaid' +copyright = u'2013-2014, Arezqui Belaid' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.5' +version = '0.6' # The full version, including alpha/beta/rc tags. -release = '0.5.0' +release = '0.6.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/includes/introduction.txt b/docs/source/includes/introduction.txt index 86bca77..a0ff716 100644 --- a/docs/source/includes/introduction.txt +++ b/docs/source/includes/introduction.txt @@ -31,15 +31,50 @@ Installation Install, upgrade and uninstall django-nvd3.py with these commands:: - $ sudo pip install django-nvd3 - $ sudo pip install --upgrade django-nvd3 - $ sudo pip uninstall django-nvd3 + $ pip install django-nvd3 + $ pip install --upgrade django-nvd3 + $ pip uninstall django-nvd3 -Or if you don't have `pip`:: - $ sudo easy_install django-nvd3 +.. _dependencies: +Dependencies +------------ + +Django-nvd3 have one major dependencie: + +* python-nvd3 : https://github.com/areski/python-nvd3 + + +Bower will be used to install D3 and NvD3, see bower website for futher info : http://bower.io/ + +Bower depends on Node and npm. It's installed globally using npm:: + + npm install -g bower + +To easy the integration with Django we will advice you to use django-bower. + +For instance to run our demo project, you will install the dependencies from requirements.txt and then +install django-bower. Django-bower is not a mandatory dependencies as the user should be free to install JS files +using different method. +To install django-bower:: + + $ pip install django-bower + +Read the documentation about Django-bower to find out how to configure it properly for your project: https://github.com/nvbn/django-bower + +Then in the demo project directory just type the following:: + + $ python manage.py bower_install + $ python manage.py collectstatic + +This will create a directory "components" where d3 & nvd3 will be installed. + +You can see example settings file in `demoproject `_. + + +.. _howto_create_piechart: Example how to create a pieChart -------------------------------- @@ -60,16 +95,24 @@ So to achieve this, we will edit our view.py, we will prepare the data that will 'extra': { 'x_is_date': False, 'x_axis_format': '', - 'tag_script_js': False, + 'tag_script_js': True, 'jquery_on_ready': False, } } return render_to_response('piechart.html', data) -We pass charttype and chartdata to use them in our template later. +We will render the template 'piechart.html' with a dictionary 'data' which contains 'charttype' and 'chartdata'. +'extra' will contains a list of additional settings:: + * ``x_is_date`` - if enabled the x-axis will be display as date format + * ``x_axis_format`` - set the x-axis date format, ie. "%d %b %Y" + * ``tag_script_js`` - if enabled it will add the javascript tag '