Last active
December 22, 2015 04:09
-
-
Save mages/6415275 to your computer and use it in GitHub Desktop.
Doughnut chart with googleVis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dat <- data.frame(party=c("CDU", "FDP", "CSU", "SPD", | |
"The Left", "The Greens"), | |
members.of.parliament=c(193, 93, 44, | |
146, 76, 68)) | |
library(googleVis) | |
## Doughnut chart - a pie with a hole | |
doughnut <- gvisPieChart(dat, | |
options=list( | |
width=500, | |
height=500, | |
slices="{0: {offset: 0.2}, | |
1: {offset: 0.2}, | |
2: {offset: 0.2}}", | |
title='German parliament 2009 - 2013 | |
(Goverment: CDU/FDP/CSU)', | |
legend='none', | |
colors="['black','orange', 'blue', | |
'red', 'purple', 'green']", | |
pieSliceText='label', | |
pieHole=0.5), | |
chartid="doughnut") | |
plot(doughnut) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment