JohnCoene / echarts4r

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

e_error_bar() does not play nice with e_flip_coords() (v0.4.4) #476

Open awcm0n opened 1 year ago

awcm0n commented 1 year ago

Error bars are displayed incorrectly after flipping the coordinates.

df <- data.frame(
  x = factor(c(1, 2)),
  y = c(1, 5),
  upper = c(1.1, 5.3),
  lower = c(0.8, 4.6)
)

df |>
  e_charts(x) |>
  e_bar(y) |>
  e_error_bar(lower, upper) |>
  e_flip_coords()

flip coords

munoztd0 commented 1 year ago

relates to #478

JohnCoene commented 1 year ago

Can look into it but I suspect it's a bit difficult to do, e_flip_coords is not part of echarts.js, it's a bit of a trick in R switching x/y variables in the dataset