Confidence Bands

Correlation Matrix

cor(mtcars) %>% 
  e_charts() %>% 
  e_correlations(order = "hclust") %>% 
  e_tooltip()

Error bars

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

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

Boxplot

df <- data.frame(
  x = c(
    rnorm(100),
    runif(100, -5, 10),
    rnorm(100, 10, 3)
  ),
  grp = c(
    rep(LETTERS[1], 100),
    rep(LETTERS[2], 100),
    rep(LETTERS[3], 100)
  )
)

df %>% 
  group_by(grp) %>% 
  e_charts() %>% 
  e_boxplot(x)

Histogram

Density

Plot the density on a different Y axis as its range differs much from the that of the histogram.

df %>%
  e_charts() %>% 
  e_histogram(y) %>% 
  e_density(y, name = "density", areaStyle = list(opacity = .4), 
            smooth = TRUE, y_index = 1) %>% 
  e_tooltip()

Linear

iris %>% 
  group_by(Species) %>% 
  e_charts(Sepal.Length) %>% 
  e_line(Sepal.Width) %>% 
  e_lm(Sepal.Width ~ Sepal.Length) %>% 
  e_x_axis(min = 4)

Polynomial

mtcars %>% 
  e_charts(disp) %>% 
  e_scatter(mpg, qsec) %>% 
  e_loess(mpg ~ disp)