I need to access a dictionary (country_stat) within javascript in a django template. I'm using google charts api that have this javascript code. The below code runs great and prints a neat map. But the values are static.
function drawRegionsMap() {
var data = google.visualization.arrayToDataTable([
['Country', 'Popularity'],
['Germany', 2],
['United States', 3],
['Brazil', 4],
['Canada', 5],
['France', 6],
['RU', 7]
]);
Printing country_stat within content block is successful.
{% for key, value in country_stat.items %}
{{key}}, {{value}}
{% endfor %}
prints,
India, 2 Russia, 1
But I don't know how to plug this into the javascript code.