
2.6 Combining charts with gvisMerge
The function gvisMerge takes two gvis-objects and merges the underlying com-
ponents into one page. The charts are aligned either horizontally or vertically next
to each other in an HTML table.
Figure 4: Three charts combined with gvisMerge.
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,
see Figure 4, aligns a geo chart and table below e ach other, and combines the output
with a motion chart to the right:
R> G <- gvisGeoChart(Exports, "Country", "Profit",
+ options=list(width=200, height=100))
R> T <- gvisTable(Exports,
+ options=list(width=200, height=270))
R> M <- gvisMotionChart(Fruits, "Fruit", "Year",
+ options=list(width=400, height=370))
R> GT <- gvisMerge(G,T, horizontal=FALSE)
R> GTM <- gvisMerge(GT, M, horizontal=TRUE,
+ tableOptions="/jointfilesconvert/482901/bgcolor=\"#CCCCCC\" cellspacing=10")
R> plot(GTM)
18
Comentários a estes Manuais