Skip to content
Advertisement

google-charts not getting displayed on the server

My code:

JavaScript

On running my app (created in Django) on the server this chart is not getting displayed, why? This page is “results.html” which is directed from my views.py file. Here “list1” contains the data stored in the table namely “file_name” and “frequency_count”. Why is this happening?

I’m new to Django, google-charts and JavaScript.

Advertisement

Answer

You may have a problem in the loop that prints the javacript array of values for the chart. I guess the filenames are strings, and as such they need to be delimited with ' or ", like this:

JavaScript

To test this, I just got rid of the loop and put a couple of rows of sample static data, like this:

JavaScript

And I got the chart working:

enter image description here

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement