My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
GvisMerge  
Updated Aug 28, 2011 by markus.g...@googlemail.com

Combing charts with gvisMerge

The function gvisMerge takes two gvis-objects and merges the underlying components into one page. The charts are aligned either horizontally or vertically next to each other in an HTML table.

The output of gvisMerge is a gvis-object again. This allows us to apply the same function iteratively to create more complex chart layouts. The following example, aligns a geo chart and table below each other, and combines the output with a motion chart to the right:

G <- gvisGeoChart(Exports, "Country", "Profit",  options=list(width=210, height=100))
T <- gvisTable(Exports, options=list(width=210, height=270))
GT <- gvisMerge(G,T, horizontal=FALSE) 
M <- gvisMotionChart(Fruits, "Fruit", "Year",
                     options=list(width=410, height=370))

GTM <- gvisMerge(GT, M, horizontal=TRUE,
                     tableOptions="bgcolor=\"#CCCCCC\" cellspacing=10")
plot(GTM)

Comment by adic...@quartzbio.com, Aug 7, 2013

Is there a way to link the charts. So that when you click on a feature, it highlights the feature with the same identifier on the other chart?

Comment by project member markus.g...@googlemail.com, Aug 7, 2013

You can use JavaScript? to achieve an interactive dashboard. See the Google Charts Tools documentation for more details. However, this is currently not possible from googleVis.

Powered by Google Project Hosting