PieCharts need to see two columns of data: 1 string type (for the slice 
labels) and 1 number type (for the slice values).  You can use a DataView 
to restrict the columns seen by the chart.  As an example, if you wanted to 
draw a PieChart with the "Insertion Name" (column 0) and "Budget" (column 
7) columns, this is how you would do it:

var view = new google.visualization.DataView(dataTable);
view.setColumns([0, 7]);
chart = new 
google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(view, options);

On Friday, April 4, 2014 7:51:46 AM UTC-4, Herrmann Hinz wrote:
>
> hi there,
>
> here is the json im using:
>
> https://gist.github.com/tobias-hinz-yoc/7028b01add47d5d71c58
>
> here is the js code to draw the table:
>
> https://gist.github.com/tobias-hinz-yoc/b227a665f0bc47fafd0e
>
>
> now i wanna use the same dataTable to draw a pieChart.
> but if i render the chart using: 
>
> *chart = new 
> google.visualization.PieChart(document.getElementById('chart_div'));*
> *chart.draw(dataTable, options);*
>
>
> .. the Pie dont turns into a pie. 
>
>
> this is propably because my table data is "too complex"? 
> i wonder if its possible to tell in the options of what values to use to 
> draw the piechart?
>
> thinking about something like this:
>
> *argumentField: "insertionName",*
>
>
>
>
>
>
> *valueField: "revenue",is there any way? maybe with data roles? did not 
> understood the concept so far at all.also was playing around with something 
> like this:*google.visualization.data.group(dataTable,[0,4]); 
>
> *help please =) *
>

-- 
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.

Reply via email to