Closed thecristen closed 8 years ago
Show me the code that this error resulted
Well, I'm not thecristen, but I too am having a bad time getting this to work. Here's the code:
from django.http import HttpResponse ... from django.template import RequestContext, loader from django import forms from graphos.sources.simple import SimpleDataSource from graphos.renderers import gchart
...
def do_graph(request):
data = [
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
]
chart = gchart.LineChart(SimpleDataSource(data=data), html_id="Line Chart")
context = RequestContext( request, {'chart':chart.as_html(),'data':data})
template = loader.get_template('s3_numbers/do_graph.html')
return HttpResponse(template.render(context))
my template is basically '{{chart}}' (I also dump the data so that I know the template is actually getting used).
The output? A blank page (with the data dumped below some white space).
Oh, while I'm here I should mention that the tutorial is misleading (or at least, I certainly was unable to copy and paste it - I had to go look at the test code to figure the above out). The tutorial says you can use 'LineChart(...)', which of course doesn't work unless you do something more than the tutorial gives.
@thecristen @rustycar54 We have updated README.md with proper documentation. Your issue should be resolved after following the readme file
Struggling to incorporate graphos with the little documentation that is available... please help.