echarts4r
echarts4r copied to clipboard
Incorrect display of confidence bands
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))

The upper bound is stated as 9.78 whereas it shoots to ~14 on the plot.
The problem has been fixed in #238 Maybe you need to update the package version to the latest.
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:

While the bands themselves are correctly plotted, the tooltip is displaying a wrong number, which is essentially upr - lwr in this example
Hi,
I have the same problem. Is there any solution so far?
Best, Sven