apexcharter/examples/apex_grid.R

21 lines
416 B
R
Raw Normal View History

2020-12-30 16:16:53 +01:00
library(apexcharter)
data("mpg", package = "ggplot2")
# Two chart side-by-side
2021-01-04 12:02:48 +01:00
a1 <- apex(mpg, aes(manufacturer), type = "bar")
2020-12-30 16:16:53 +01:00
2021-01-04 12:02:48 +01:00
a2 <- apex(mpg, aes(trans), type = "column")
2020-12-30 16:16:53 +01:00
apex_grid(a1, a2, height = "400px")
# More complex layout:
2021-01-04 12:02:48 +01:00
a3 <- apex(mpg, aes(drv), type = "pie")
2020-12-30 16:16:53 +01:00
apex_grid(
a1, a2, a3,
grid_area = c("1 / 1 / 3 / 2", "1 / 2 / 2 / 4", "2 / 2 / 3 / 4"),
ncol = 3, nrow = 2,
height = "600px"
)