JohnCoene / echarts4r

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

Can't pass areaStyle to e_area() #501

Closed gacolitti closed 1 year ago

gacolitti commented 1 year ago

I can pass a lineStyle and itemStyle to e_area(), but areaStyle does not work.

For example:

library(echarts4r)
data.frame(x = seq.int(1, 5, 1),
           y = 10) %>% 
  e_chart(x = x) %>% 
  e_area(
    serie = y,
    areaStyle = list(opacity = 0),
    lineStyle = list(opacity = 0),
    itemStyle = list(opacity = 0)
  )

Please see this stackoverflow.

JohnCoene commented 1 year ago

Yes, sorry, this is going to be overridden.

Use e_line with areaStyle.

(In echarts.js an area chart is essentially this: a line with areaStyle)

gacolitti commented 1 year ago

Yep, I should have thought of trying that. Thanks!

Here it is again with e_line():

library(echarts4r)
library(magrittr)

data.frame(x = seq.int(1, 5, 1),
           y = 10) %>% 
  e_chart(x = x) %>% 
  e_line(
    serie = y,
    areaStyle = list(opacity = 0),
    lineStyle = list(opacity = 0),
    itemStyle = list(opacity = 0)
  )
rdatasculptor commented 1 year ago

@gacolitti I think you can close the issue 🙂, thanks!