1

I am attempting to generate some graphs on my Django-powered site by utilizing the gviz_api module. I run an algorithm on my data held within my Django models, arriving at the data to be graphed. Note that I do not wish to graph data directly from my models: this makes the several existing python-gviz "wrapper" modules not very useful to my cause.

That said, I have successfully loaded all of my data in to a gviz DataTable inside Django. My question is... what next? I have a lot of experience with Python, but next to non with Javascript. Some specific questions:

  • Do I pass the DataTable to javascript via a template variable in Django?
  • Do I want to use .ToJSon(), .ToJSonResponse(), or .ToJScript() before passing it?
  • How do I integrate the template variable into my code?
  • Are there any required dependencies on my server?

I've been hacking into examples trying to get a chart with my data, but no dice. I get nothing displayed. Unfortunately, the gviz_api documentation for outputting data provides very little depth. My research has turned up nothing, but it seems a lot of others are also wondering how it works!

Thanks!

TaylerJones
  • 242
  • 2
  • 15

0 Answers0