Do anyone reply here?



On Tuesday, October 10, 2017 at 5:12:07 PM UTC+5, Inzimam Tariq wrote:
>
> 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 google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
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/e80cc30d-f494-40e8-9c9b-97f906b2982c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to