Google Charts Line Graph Axes Synchronization

25 views
Skip to first unread message

Gaurav Pandey

unread,
Jun 28, 2016, 4:41:25 AM6/28/16
to Google Visualization API
Hi,
I am using googleVis package in R to create line chart(Google Chart) with two axis using function :

df=data.frame(country=c("US", "GB", "BR"), val1=c(10,13,14), val2=c(100,150,200)) 
Line2 <- gvisLineChart(df, "country", c("val1","val2"), options=list(series="[{targetAxisIndex: 0}, {targetAxisIndex:1}]", vAxes="[{title:'val1'}, {title:'val2'}]"))
plot(Line2)

Now the graph has two axis but the values of the two axis are very different. So is there any method of synchronizing the two axis in googleVis package?

Thanks in Advance For Helping :)

Daniel LaLiberte

unread,
Jun 28, 2016, 9:53:15 AM6/28/16
to Google Visualization API
I don't know much about this googleVis package, which is written by someone outside of Google.  But from your examples, it appears you should be able to add options to control the viewWindow and chartArea to get the values you want.  I don't know what values you want, but it would be something like this:

options=list(
  chartArea="{width:200, height:200}",
  hAxis="{viewWindow:{min:0,max:200}}",
  vAxis="{viewWindow:{min:0,max:200}}", ...
)

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/4f81d8f3-8d4d-4f8d-98f5-fecb1f484a2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages