Grouping Sections of Pie Chart

1,288 views
Skip to first unread message

Emily Schechter

unread,
Jan 15, 2013, 2:35:52 PM1/15/13
to google-visua...@googlegroups.com
Hi Everyone,

Is it possible to "group" together sections of my pie chart? I have 2 main categories, which each have about 7 smaller categories, so I was hoping to display display 1 chart with all 14 categories in which the two overarching groups were clearly differentiated.

For example, if my data for how I spend my day was:
Work Activities: Answer phone (4 hours), File papers (4 hours), Leisure Activities: Sleep (8 hours), Watch TV (8 hours)

Could I make a chart of all 24 hours in which the Work Activities slices were all next to each other and the Leisure Activities slices were all next to each other, each with perhaps a different color scheme? I know that I can change colors of slices manually but was also hoping I could pass in something like "Type of Activity" to make them appear next to each other (+ I'm not sure if I can even define colors manually because the number of categories within the chart changes dynamically based on the pulled data)

Let me know any thoughts. Thanks!

Daniel LaLiberte

unread,
Jan 15, 2013, 3:17:00 PM1/15/13
to google-visua...@googlegroups.com
Hi Emily,

It sounds like what you might want is a Sunburst chart.  See http://www.cc.gatech.edu/gvu/ii/sunburst/ for some examples.

GViz doesn't support Sunburst charts yet, though we may do that soon, perhaps as a generalization of the PieChart.  The only alternative I can suggest now would involve using a Dashboard to let the user select from the list of main categories, and you would only show the smaller categories in your PieChart.  Hope that helps.

dan



--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/NIidyv99g4oJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.



--
dlaliberte@Google.com   562D 5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

asgallant

unread,
Jan 15, 2013, 5:48:36 PM1/15/13
to google-visua...@googlegroups.com
Pie slices are drawn in the order of the rows presented to the PieChart, so if you sort the data in a DataView, you can group them together that way.  You can also dynamically calculate the number of slices per group and create a list of colors based on the number of slices.  Here's an example: http://jsfiddle.net/asgallant/4kuFU/
Reply all
Reply to author
Forward
0 new messages