You can mark points, lines and areas on your chart to emphasise certain things.

Type

You mark things by passing a list to the data argument, this list can be of many different format, see the official documentation.

One of the format is to pass a type:

  • min
  • max
  • avg

By default e_mark_* is applied to all series.

iris %>% 
  group_by(Species) %>% 
  e_charts(Sepal.Length) %>% 
  e_line(Sepal.Width) %>% 
  e_mark_point(data = max) %>% 
  e_mark_point(data = min) %>% 
  e_mark_point(data = avg)

But you can specify one or more serie it should apply apply to.

iris %>% 
  group_by(Species) %>% 
  e_charts(Sepal.Length) %>% 
  e_line(Sepal.Width) %>% 
  e_mark_point(serie = "setosa", data = max) %>% 
  e_mark_point(serie = c("virginica", "setosa"), data = min) %>% 
  e_mark_point(serie = c("virginica", "versicolor"), data = avg)

Custom

Point

iris %>% 
  group_by(Species) %>% 
  e_charts(Sepal.Length) %>% 
  e_line(Sepal.Width) %>% 
  e_mark_point(data = avg) %>% 
  e_x_axis(min = 4)

Line

iris %>% 
  group_by(Species) %>% 
  e_charts(Sepal.Length) %>% 
  e_line(Sepal.Width) %>% 
  e_mark_line(data = avg) %>% 
  e_x_axis(min = 4)

Area

iris %>% 
  group_by(Species) %>% 
  e_charts(Sepal.Length) %>% 
  e_line(Sepal.Width) %>% 
  e_mark_area(
    data = list(
      list(xAxis = "min", yAxis = "min"), 
      list(xAxis = "max", yAxis = "max")
    )
  ) %>% 
  e_x_axis(min = 4)