Skip to content

Instantly share code, notes, and snippets.

@mages
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mages/9564875 to your computer and use it in GitHub Desktop.
Save mages/9564875 to your computer and use it in GitHub Desktop.
dat <- data.frame(Position=c(rep("President", 3), rep("Vice", 3)),
Name=c("Washington", "Adams", "Jefferson",
"Adams", "Jefferson", "Burr"),
start=as.Date(x=rep(c("1789-03-29", "1797-02-03",
"1801-02-03"),2)),
end=as.Date(x=rep(c("1797-02-03", "1801-02-03",
"1809-02-03"),2)))
plot(
gvisTimeline(data=dat, rowlabel="Name",barlabel="Position",
start="start", end="end",
options=list(
timeline="{rowLabelStyle:{fontName:'Helvetica',
fontSize:10, color:'#603913'},
barLabelStyle:{fontName:'Garamond',
fontSize:12}}",
backgroundColor='#ffd', height=220,
colors="['#cbb69d', '#603913', '#c69c6e']"),
chartid="presidents")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment