Skip to contents

Create facets for multiple plots.

Usage

e_facet(e, rows = 1, cols = 1, legend_pos = "top", legend_space = 10)

Arguments

e

An echarts4r object as returned by e_charts or a proxy as returned by echarts4rProxy.

rows, cols

Number of rows and columns.

legend_pos

Position of the legend

legend_space

Space between legend and plot area.

Details

Each serie, i.e.: e_bar will be plotted against a facet.

Examples

group_size <- 20
n_groups <- 13
df <- data.frame("day" = rep(1:group_size, times=n_groups), 
                 "temperature" = runif(group_size * n_groups, 10, 40),
                 "location" = rep(LETTERS[1:n_groups], each=group_size))

df |> 
  group_by(location) |> 
  e_charts(day) |> 
  e_line(temperature) |> 
  e_facet(rows = 4, cols=4, legend_pos = "top", legend_space = 12)