Skip to content

Instantly share code, notes, and snippets.

@mages
Created November 20, 2011 12:13
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/1380205 to your computer and use it in GitHub Desktop.
Save mages/1380205 to your computer and use it in GitHub Desktop.
library(googleVis)
df <- data.frame(country=c("US", "GB", "BR"), val1=c(10,13,14), val2=c(23,12,32))
Line <- gvisLineChart(df, xvar="country", yvar=c("val1","val2"),
options=list(
title="Hello World",
titleTextStyle="{color:'red',
fontName:'Courier',
fontSize:16}",
backgroundColor="#D3D3D3",
vAxis="{gridlineColor:'#FFFFFF'}",
hAxis="{title:'Country',
titleTextStyle:{color:'blue'}}",
series="[{color:'green', targetAxisIndex: 0},
{color: 'orange',targetAxisIndex:1}]",
vAxes="[{title:'val1'}, {title:'val2'}]",
legend="bottom",
curveType='function',
width=500,
height=300
))
plot(Line)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment