-
Notifications
You must be signed in to change notification settings - Fork 124
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
How to Use X-Axis Dates #48
Comments
Same issue. The documentation could benefit from using "fixed" dummy data, instead of random generated data. |
Here is a solution. You need to pass a value that the JavaScript Date object can use. I chose
As it seems the most reliable. Now you need to prepare your data. A quick example would be:
I hope this helps someone. |
This helped me solve a problem that I've been sitting on for hours. Lifesaver, thank you @aaronvanderlip |
what data are the examples for the date? @Nicolas-Prinsloo and @aaronvanderlip |
I am attempting to use django-nvd3 to create a simple line chart with dates on the X axis and integers on the Y axis. At first I was using actual
datetime
objects for the X axis data, but that resulted in "not JSON serializable" errors, so now I'm using string representations of dates. The chart code in my view looks liket this:This results in a chart with the proper Y axis. However, I see no lines and the X axis is labelled "31 Dec 1969, 31 Dec 1969, 31 Dec 1969".
How am I supposed to specify that the contents of
xdata
are string representations of dates?The text was updated successfully, but these errors were encountered: