Skip to content

Instantly share code, notes, and snippets.

@OrenBochman
Forked from mages/DoughnutChart.R
Created September 15, 2013 17:30
Show Gist options
  • Save OrenBochman/6572774 to your computer and use it in GitHub Desktop.
Save OrenBochman/6572774 to your computer and use it in GitHub Desktop.
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