求助的问题:用echart4r包画树图,第四层有数据但是没显示出来
代码如下:
library(echarts4r)
library(tibble)
tree <- tibble(name = "1", # 1st level
children = list(tibble(
name = c("1-1", # 2nd level
"1-2",
"1-3"),
children = list(
tibble(
name = c("1-1-1", "1-1-2"), # 3rd level
children = list(NULL, tibble(
name = c("1-1-2-1", "1-1-2-2") #4th level
))
)
,
tibble(
name = c("1-2-1", "1-2-2"), # 3rd level
children = list(NULL, tibble(
name = c("1-2-2-1", "1-2-2-2") # 4th level
))
),
NULL
)
)))
tree %>%
e_charts() %>%
e_tree() %>%
e_labels(position = "top")