JohnCoene / echarts4r

🐳 ECharts 5 for R
http://echarts4r.john-coene.com/
Other
585 stars 82 forks source link

Cannot modify labels in funnel chart (v0.4.5) #581

Closed awcm0n closed 6 months ago

awcm0n commented 8 months ago

The following code should suppress the labels of a funnel chart but causes an error instead:

library(echarts4r)

df <- data.frame(stage = c("x", "y", "z"),
                     n = c(100, 66, 33))
df |>
  e_charts() |>
  e_funnel(n, stage, 
           label=list(show=FALSE))

Output:

Error in `dplyr::select()`:
! Can't subset columns that don't exist.
✖ Column `list(show = FALSE)` doesn't exist.
rdatasculptor commented 8 months ago

@awcm0n I agree it looks like a bug. However, there is another approach that has the intended result. Maybe that will help you out for now:

library(echarts4r)

df <- data.frame(stage = c("x", "y", "z"),
                     n = c(100, 66, 33))
df |>
  e_charts() |>
  e_funnel(n, stage) |>
e_labels(show = FALSE)