agiliq / django-graphos

Django charting made *really* easy.
http://agiliq.com/demo/graphos
BSD 2-Clause "Simplified" License
441 stars 98 forks source link

maximum recursion depth exceeded on LineChart #141

Open lengzuo opened 6 years ago

lengzuo commented 6 years ago

response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Users/lengzuo/Desktop/sreport/reports/views.py", line 20, in LineChart chart = LineChart(data_source) File "/Users/lengzuo/Desktop/sreport/reports/views.py", line 20, in LineChart chart = LineChart(data_source) File "/Users/lengzuo/Desktop/sreport/reports/views.py", line 20, in LineChart chart = LineChart(data_source) [Previous line repeated 930 more times] File "/Users/lengzuo/Desktop/sreport/reports/views.py", line 17, in LineChart data_source = SimpleDataSource(data=data) RecursionError: maximum recursion depth exceeded

Code as below: ` def LineChart(request): data = [ ['Year', 'Sales', 'Expenses', 'Items Sold', 'Net Profit'], ['2004', 1000, 400, 100, 600], ['2005', 1170, 460, 120, 710], ['2006', 660, 1120, 50, -460], ['2007', 1030, 540, 100, 490], ]

DataSource object

data_source = SimpleDataSource(data=data)
print('data :%s ' % data_source)
# Chart object
chart = LineChart(data_source)
context = {'chart': chart}
return render(request, 'index.html', context)

`