JohnCoene / echarts4r

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

aria decal only on bottom bar #589

Closed oobd closed 7 months ago

oobd commented 7 months ago

If I apply aria decal to a stacked bar chart like below, I get an output where both top and bottom bars have the decal applied. Is there a way to specify only the top bar as having decal?

I have tried e_add_nested but that doesn't seem to work for decals

library(echarts4r)
library(tidyverse)

d <- data.frame(
   xaxis = c(rep("a", 2), rep("b", 2)),
   groups  = c("c", "d", "c", "d"),
   value = rnorm(4, mean = 50)
   ) |>
   group_by(xaxis) |>
   dplyr::mutate(Label = value)

d |>
  group_by(groups) |>
  e_chart(xaxis) |>
  e_bar(value, stack = "groups",
     bind = Label,
     label = list(
       show = TRUE,
       formatter = "{b}",
       position = "inside"
     )
  ) |>
  e_aria(enabled = TRUE, decal = list(show = TRUE))

image

JohnCoene commented 7 months ago

I'm afraid not it's this option, it's a global that's applied to all series though some customisation is avaialble

oobd commented 7 months ago

thanks John