How to use "itemStyle" for multiple series on echarts4r?

Hello and thanks for reading me. Im trying to create a plot with conditional colors and I want to have the same colors for the scatter serie, but im just getting the custom color for the first serie. How I can apply the custom color for both series?

The code is the following:


  year = as.character(sample(1950:2020, 100, replace = T)),
  y = rnorm(100, 10, 3)
) |> 
  head(10) |> 
    color = if_else(y > 9, "red", "green")
  ) |> 
  e_charts(year) |> 
  e_bar(y ) |> 
  e_scatter(y) |> 
  e_add_nested("itemStyle", color) 

Thanks for the help

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.