Skip to content

Instantly share code, notes, and snippets.

@mages
Last active December 20, 2015 16:38
Show Gist options
  • Save mages/6162552 to your computer and use it in GitHub Desktop.
Save mages/6162552 to your computer and use it in GitHub Desktop.
Set y limits individually in googleVis
set.seed(1234)
dat <- data.frame(x=LETTERS[1:10], y_1=sample(15,10), y_2=sample(150,10))
area2 <- gvisAreaChart(xvar="x", yvar=c("y_1", "y_2"), data=dat,
options=list(
series="[{targetAxisIndex:0},
{targetAxisIndex:1}]",
vAxes="[{viewWindowMode:'explicit',
viewWindow:{min:0, max:10}},
{viewWindowMode:'explicit',
viewWindow:{min:0, max:100}}]",
title="y-limits set individually",
width=500, height=400),
chartid="area2ylim")
plot(area2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment