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

band2

Area bands


Description

Add area bands

Usage

e_band2(e, lower, upper, ...)

e_band2_(
  e,
  lower,
  upper,
  name = NULL,
  legend = TRUE,
  y_index = 0,
  x_index = 0,
  coord_system = "cartesian2d",
  itemStyle = list(borderWidth = 0.5),
  ...
)

Arguments

e

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

lower, upper

series of lower and upper borders of the band

...

additional options

name

name of the serie.

legend

Whether to add serie to legend.

y_index

Indexes of x and y axis.

x_index

Indexes of x and y axis.

coord_system

Coordinate system to plot against.

itemStyle

mostly used for borderWidth, default 0.5

Examples

data(EuStockMarkets)
as.data.frame(EuStockMarkets) %>%
  dplyr::slice_head(n = 200) %>%
  dplyr::mutate(day = 1:dplyr::n()) %>%
  e_charts(day) %>%
  e_line(CAC, symbol = "none") %>%
  e_band2(DAX, FTSE, color = "lemonchiffon") %>%
  e_band2(DAX, SMI, color = "lightblue", itemStyle = list(borderWidth = 0)) %>%
  e_y_axis(scale = TRUE) %>%
  e_datazoom(start = 50)

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.