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, since the mark of "virginica" is not set, the mark setting
# of the previous frame is used
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",
data = list(
list(xAxis = 4, yAxis = 2),
list(xAxis = 6, yAxis = 4.5)
),
itemStyle = list(color = "lightgreen")
) |>
e_mark_area(
serie = "versicolor",
data = list(
list(xAxis = 4.5),
list(xAxis = 7)
),
itemStyle = list(color = "lightblue")
)
Run the code above in your browser using DataLab