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

mark

Mark point


Description

Mark points and lines.

Usage

e_mark_point(
  e,
  serie = NULL,
  data = NULL,
  ...,
  title = NULL,
  title_position = NULL
)

e_mark_line(
  e,
  serie = NULL,
  data = NULL,
  ...,
  title = NULL,
  title_position = NULL
)

e_mark_area(
  e,
  serie = NULL,
  data = NULL,
  ...,
  title = NULL,
  title_position = NULL
)

Arguments

e

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

serie

Serie or vector of series to mark on, defaults to all series.

data

Placement of point, line or area.

...

Any other option to pass, check See Also section.

title

A convenience argument to easily set label, see details.

title_position

Position of title.

Details

To set a label you need to either use the title argument or pass a list specifying the label formatter. label = list(formatter = "label"). The former is more convenient but more limited, e.g.: you cannot specify the placement of the label.

See Also

Examples

max <- list(
  name = "Max",
  type = "max"
)

min <- list(
  name = "Min",
  type = "min"
)

avg <- list(
  type = "average",
  name = "AVG"
)

mtcars %>%
  e_charts(mpg) %>%
  e_line(wt) %>%
  e_line(drat) %>%
  e_line(cyl) %>%
  e_mark_point("wt", data = max) %>%
  e_mark_point(c("cyl", "drat"), data = min) %>%
  e_mark_line(data = avg) %>% # applies to all
  e_mark_area(
    serie = "wt",
    data = list(
      list(xAxis = "min", yAxis = "min"),
      list(xAxis = "max", yAxis = "max")
    )
  )

# serie options

iris %>%
  group_by(Species) %>%
  e_charts(Sepal.Length, timeline = TRUE) %>%
  e_line(Sepal.Width) %>%
  e_timeline_serie(
    title = list(
      list(text = "setosa"),
      list(text = "versicolor"),
      list(text = "virginica")
    )
  ) %>%
  e_mark_area(serie = "setosa") %>%
  e_mark_area(
    serie = "versicolor",
    data = list(
      list(xAxis = 2),
      list(xAxis = 4)
    ),
    itemStyle = list(color = "lightblue")
  ) %>%
  e_mark_area(serie = "virginica")

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.