# funnel can take nested itemStyle
# https://echarts.apache.org/en/option.html#series-funnel.data
funnel <- data.frame(
stage = c("View", "Click", "Purchase"),
value = c(80, 30, 20),
color = c("blue", "red", "green")
)
funnel |>
e_charts() |>
e_funnel(value, stage) |>
e_add_nested("itemStyle", color)
# Heatmap can take nested label
# https://echarts.apache.org/en/option.html#series-heatmap.data
v <- LETTERS[1:10]
matrix <- data.frame(
x = sample(v, 300, replace = TRUE),
y = sample(v, 300, replace = TRUE),
z = rnorm(300, 10, 1),
stringsAsFactors = FALSE
) |>
dplyr::group_by(x, y) |>
dplyr::summarise(z = sum(z)) |>
dplyr::ungroup() |>
dplyr::mutate(
show = TRUE,
fontStyle = round(runif(dplyr::n(), 5, 12))
)
matrix |>
e_charts(x) |>
e_heatmap(y, z) |>
e_visual_map(z) |>
e_add_nested(
"label",
show,
fontStyle
)
Run the code above in your browser using DataLab