Doughnut chart in R with googleVis

6 comments
The guys at Google continue to update and enhance the Chart Tools API. One new recent feature is a pie chart with a hole, or as some call them: donut charts.

Thankfully the new functionality is being achieved through new options for the existing pie chart, which means that those new features are available in R via googleVis as well, without the need of writing new code.

Doughnut chart example

With the German election coming up soon, here is the composition of the current parliament.


Session Info

R version 3.0.1 (2013-05-16)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods  
[7] base     

other attached packages:
[1] googleVis_0.4.5

loaded via a namespace (and not attached):
[1] RJSONIO_1.0-3 tools_3.0.1 

6 comments :

Ben Sullins said...

"One new recent feature is a pie chart with a hole" this should be listed as a bug, not a feature

JNFoo said...

Thank you for this Markus - is it possible to do multilevel donut plots with this?

For example:
http://www.powerpointinfographics.com/blogs/news/6351480-how-to-create-a-multi-level-pie-chart

Markus Gesmann said...

No, unfortunately I don't think so.

JNFoo said...

Oh well. Will you consider this an informal feature request? :-)

Markus Gesmann said...

Well, googleVis is only an interface to the Google Chart Tools and as long as the API doesn't support this feature there is little I can do.

JNFoo said...

Understood. I've submitted a feature request to the Chart Tools issue tracker. It's a long shot but I'll keep my fingers crossed.

Post a Comment