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

e_legend

Legend


Description

Customise the legend.

Usage

e_legend(e, show = TRUE, type = c("plain", "scroll"), icons = NULL, ...)

Arguments

e

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

show

Set to FALSE to hide the legend.

type

Type of legend, plain or scroll.

icons

A optional list of icons the same length as there are series, see example.

...

Any other option to pass, check See Also section.

See Also

Examples

e <- cars %>%
  e_charts(speed) %>%
  e_scatter(dist, symbol_size = 5)

# with legend
e

# without legend
e %>%
  e_legend(show = FALSE)

# with icon
# path is taken from http://svgicons.sparkk.fr/
path <- paste0(
  "path://M11.344,5.71c0-0.73,0.074-1.122,1.199-1.122",
  "h1.502V1.871h-2.404c-2.886,0-3.903,1.36-3.903,3.646",
  "v1.765h-1.8V10h1.8v8.128h3.601V10h2.403l0.32-2.718h",
  "-2.724L11.344,5.71z"
)

e %>%
  e_legend(
    icons = list(path)
  )

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.