Learn R Programming

echarts4r (version 0.5.0)

band2: Area bands

Description

Add area bands

Usage

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

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

name

name of the serie.

legend

Whether to add serie to legend.

x_index, y_index

Indexes of x and y axis.

coord_system

Coordinate system to plot against.

itemStyle

mostly used for borderWidth, default 0.5

...

additional options

Examples

Run this code
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)

Run the code above in your browser using DataLab