Giter Site home page Giter Site logo

Comments (3)

luzfcb avatar luzfcb commented on July 4, 2024

Show me the code that this error resulted

from django-graphos.

rustycar54 avatar rustycar54 commented on July 4, 2024

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):
# get data
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.

from django-graphos.

akshar-raaj avatar akshar-raaj commented on July 4, 2024

@thecristen @rustycar54 We have updated README.md with proper documentation. Your issue should be resolved after following the readme file

from django-graphos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.