echarts4r icon indicating copy to clipboard operation
echarts4r copied to clipboard

Incorrect display of confidence bands

Open Alik-V opened this issue 4 years ago • 3 comments
trafficstars

Hi John, Thanks a lot for this package, it's been a tremendous pleasure using it so far.

I am having a problem creating confidence intervals using e_bands function. It seems that upper band is always overstating itself. If we follow the example in documentation with an addition of tooltips:

set.seed(5)
df <- data.frame(
  x = 1:10,
  y = runif(10, 5, 10)
) %>%
  dplyr::mutate(
    lwr = y - runif(10, 1, 3),
    upr = y + runif(10, 2, 4)
  )
df %>%
  e_charts(x) %>%
  e_line(y) %>%
  e_band(lwr, upr) %>%
  e_tooltip(trigger = "axis", formatter = e_tooltip_pointer_formatter(digits = 2))

image

The upper bound is stated as 9.78 whereas it shoots to ~14 on the plot.

Alik-V avatar Jun 23 '21 14:06 Alik-V

The problem has been fixed in #238 Maybe you need to update the package version to the latest.

swsoyee avatar Jun 23 '21 14:06 swsoyee

Thank you @swsoyee! Updating to 0.4.0 did indeed fix the issue of incorrect band display. However, there might be another potential bug with the tooltips. Running the code above results in the following dataset and plot: image image

While the bands themselves are correctly plotted, the tooltip is displaying a wrong number, which is essentially upr - lwr in this example

Alik-V avatar Jul 02 '21 10:07 Alik-V

Hi,

I have the same problem. Is there any solution so far?

Best, Sven

svenb78 avatar Dec 28 '21 12:12 svenb78