Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineChart example in documentation errors #140

Open
V3ckt0r opened this issue Apr 12, 2017 · 1 comment
Open

LineChart example in documentation errors #140

V3ckt0r opened this issue Apr 12, 2017 · 1 comment

Comments

@V3ckt0r
Copy link

V3ckt0r commented Apr 12, 2017

Hi guys,

Just looking at the example given here: http://python-nvd3.readthedocs.io/en/latest/classes-doc/line-chart.html. Running the code:

from nvd3 import lineChart
chart = lineChart(name="lineChart", x_is_date=False, x_axis_format="AM_PM")

xdata = range(24)
ydata = [0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 4, 3, 3, 5, 7, 5, 3, 16, 6, 9, 15, 4, 12]
ydata2 = [9, 8, 11, 8, 3, 7, 10, 8, 6, 6, 9, 6, 5, 4, 3, 10, 0, 6, 3, 1, 0, 0, 0, 1]

extra_serie = {"tooltip": {"y_start": "There are ", "y_end": " calls"}}
chart.add_serie(y=ydata, x=xdata, name='sine', extra=extra_serie, **kwargs1)
extra_serie = {"tooltip": {"y_start": "", "y_end": " min"}}
chart.add_serie(y=ydata2, x=xdata, name='cose', extra=extra_serie, **kwargs2)
chart.buildhtml()

when running the python code the below output is given:

python line-graph.py
Traceback (most recent call last):
File "line-graph.py", line 9, in <module>
chart.add_serie(y=ydata, x=xdata, name='sine', extra=extra_serie, **kwargs1)
NameError: name 'kwargs1' is not defined

Version of D3 and and NVD3 as reported by Bower are as follows:
NVD3 = 1.8.5
D3 = 3.5.17

@rmaheshkumarblr
Copy link

Just pass chart.add_serie(y=ydata, x=xdata, name='sine', extra=extra_serie). **kwargs1 to be used when you need additional functionality...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants