[Answer]-Google-charts not getting displayed on the server

1👍

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:

{% for l in list1 %}
    ['{{ l.file_name }}', {{ l.frequency_count }}], 
{% endfor %}

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

var data = google.visualization.arrayToDataTable([
        ['FileName', 'Frequency'],
            ['this', 100],
            ['that', 200]
        ]);

And I got the chart working:

enter image description here

👤AJJ

Leave a comment