Learn R Programming

echarts4r (version 0.2.0)

e_treemap: Treemap

Description

Build a treemap.

Usage

e_treemap(e, parent, child, value, rm_x = TRUE, rm_y = TRUE, ...)

e_treemap_(e, parent, child, value, rm_x = TRUE, rm_y = TRUE, ...)

Arguments

e

An echarts4r object as returned by e_charts.

parent, child

Edges.

value

Value of edges.

rm_x, rm_y

Whether to remove x and y axis, defaults to TRUE.

...

Any other option to pass, check See Also section.

See Also

Additional arguments

Examples

Run this code
# NOT RUN {
df <- data.frame(
  parent = c("earth", "earth", "earth", "mars", "mars"), 
  child = c("forest", "ocean", "iceberg", "elon", "curiosity"),
  value = ceiling(rnorm(5, 10, 2))
)

df %>% 
  e_charts() %>% 
  e_treemap(parent, child, value)
  
# }

Run the code above in your browser using DataLab