areski / django-nvd3

Django wrapper for nvd3 - It's time for beautiful charts
Other
416 stars 124 forks source link

Datetime handling #46

Closed nils-werner closed 9 years ago

nils-werner commented 9 years ago

The current way of handling date axises is very convoluted and requires a lot of boilerplate code, e.g.

start_time = int(time.mktime(datetime.datetime(2012, 6, 1).timetuple()) * 1000)
nb_element = 100
xdata = range(nb_element)
xdata = map(lambda x: start_time + x * 1000000000, xdata)

This makes it very easy to make mistakes and is very cumbersome to the user. Django itself is using datetime.datetime which allows much nicer handling of this kind of data.

I thing django-nvd3 should allow the use of proper datetime data instead of asking the user to fiddle with epoch milliseconds...

areski commented 9 years ago

This is just for the demo project, it's only an example to show how django-nvd3 is used, but please feel free to send a PR with a better example.

nils-werner commented 9 years ago

Ah sorry, I was confusing this with python-nvd3

areski commented 9 years ago

Ok I will close this ticket then, go ahead and reopen if you need so