Hi,
I'm using twig file and copied code from google site. When I tried adding
hard coded values its perfect But I have to show add values in pie chart
So, When I try dynamically It shows all but the last value do not show up
in chart. Also legend of the chart shows that value as "other" not the name
& value of that.
I tried with
data = new google.visualization.DataTable();
and also with
var data = google.visualization.arrayToDataTable([]);
methods But the result is same. Can Anybody help me on this?
Here is how I'm adding values to chart
Method 1. var data = new google.visualization.DataTable();
data.addColumn('string', 'Store');
data.addColumn('number', 'Type');
data.addRows([
{% for category in categories %}
{% if loop.last %}
['{{ category.name }}', {{ category.survey }}]
{% else %}['{{ category.name }}', {{ category.survey }}],
{% endif %}
{% endfor %}
]);
Method 2. var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
{% for category in categories %}
['{{ category.name }}', {{ category.survey }}],
{% endfor %}
]);
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/de53cd25-a5db-4cad-ae72-72a642018841%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.