areski / django-nvd3

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

Issues with lineChart #8

Closed Faerbit closed 11 years ago

Faerbit commented 11 years ago

Hi,

I am trying to create a lineChart. When I execute my view function I get something like this: {'charttype': 'lineChart', 'charttdata': {'name1': 'Fabian', 'y1': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'x': ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']}} Is there something wrong with it? Because everytime I try to render it I get this weird error: http://dpaste.com/hold/1276225/ Also your demo for linechart doesn't work because it has got an index out of range. I'm also not quite sure what's up with these extra series. Maybe drop a sentence or two in your documentation?

I know this is a lot of problems for one issue, but I wasn't comfortable making seperate ones since this could be a really dumb mistake on my side.

areski commented 11 years ago

We will suggest you to use "Discrete Bar Chart" as this chart have x-axis with non number format.

Faerbit commented 11 years ago

I didn't realize that it wasn't possible to display text on the x-axis on a lineChart. But I really would like to use a linechart. So I've come up with this: {'charttdata': {'y1': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 'x': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 'name1': 'Fabian'}, 'charttype': 'lineChart'} And it gives me this error: http://dpaste.com/hold/1290626/ I also tried this: {'charttype': 'lineChart', 'charttdata': {'name1': 'Fabian', 'x': [datetime.date(2013, 1, 1), datetime.date(2013, 2, 1), datetime.date(2013, 3, 1), datetime.date(2013, 4, 1), datetime.date(2013, 5, 1), datetime.date(2013, 6, 1), datetime.date(2013, 7, 1), datetime.date(2013, 8, 1), datetime.date(2013, 9, 1), datetime.date(2013, 10, 1), datetime.date(2013, 11, 1), datetime.date(2013, 12, 1)], 'y1': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}} And it gives me this error: http://dpaste.com/hold/1290629/

I'm also really confused what this error is supposed to mean.