Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

connections

Connect charts


Description

Connect charts together.

Usage

e_connect(e, ids)

e_group(e, group)

e_connect_group(e, group)

e_disconnect_group(e, group = NULL)

e_arrange(..., rows = NULL, cols = NULL, width = "xs", title = NULL)

Arguments

e

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

ids

Scalar, vector or list of ids of chart to connect with.

group

Group name.

...

Any echarts objects.

rows, cols

Number of rows and columns.

width

Wdith of columns, one of xs, md, lg.

title

Title of charts.

Value

e_arrange: in an interactive session, returns a htmltools::browsable, in rmarkdown returns a container (htmltools::div).

Functions

  • e_connect: connects charts by ids, cannot be disconnected.

  • e_group: assigns a group to chart.

  • e_connect_group: connects chart with another group.

  • e_disconnect_group: diconnects chart from group.

  • e_arrange: arrange charts.

Note

e_arrange may not work properly in the RStudio viewer.

Examples

# linked datazoom
e1 <- cars %>%
  e_charts(
    speed,
    height = 200
  ) %>%
  e_scatter(dist) %>%
  e_datazoom(show = FALSE) %>%
  e_group("grp") # assign group

e2 <- cars %>%
  e_charts(
    dist,
    height = 200
  ) %>%
  e_scatter(speed) %>%
  e_datazoom() %>%
  e_group("grp") %>% # assign group
  e_connect_group("grp") # connect

if (interactive()) {
  e_arrange(e1, e2, title = "Linked datazoom")
}

echarts4r

Create Interactive Graphs with 'Echarts JavaScript' Version 5

v0.4.0
Apache License (>= 2.0)
Authors
John Coene [aut, cre, cph], Wei Su [ctb], Helgasoft [ctb], Xianying Tan [ctb] (<https://orcid.org/0000-0002-6072-3521>)
Initial release
2021-03-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.