Skip to content

Instantly share code, notes, and snippets.

@mages
Last active December 22, 2015 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mages/6415275 to your computer and use it in GitHub Desktop.
Save mages/6415275 to your computer and use it in GitHub Desktop.
Doughnut chart with googleVis
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