1

I'm wanting to combine multiple lower/value/upper style series in one graph with shaded bars. Is it possible to create?

For example, for xts object "new_df" below:

df <- data.frame("value" = c(1,2,3,4,5), "upper1" = c(1.2, 2.3, 3.1, 4.6, 5.9), "lower1" = c(0.5, 1.8, 2.6, 3.7, 4.9), "upper2" = c(1.2, 2.1, 3.5, 4.8, 5.9), "lower2" = c(0.3, 1.4, 2.7, 3.5, 4.8))
dates <- c("2014-10-01", "2014-11-01", "2014-12-01", "2015-01-01", "2015-02-01")
time <- as.Date(dates)
new_df <- as.xts(df, order.by = time)

This is new_df:

enter image description here

This is example of plot that I want to get, but I want to get multiple in one graph enter image description here

MLavoie
  • 9,671
  • 41
  • 36
  • 56
Cuong.S
  • 39
  • 1
  • 1
  • 5

1 Answers1

1

Are you looking for this?

dygraph(new_df, main = "testing") %>%
  dySeries(c("lower1", "value", "upper1"), label = "num1") %>% 
  dySeries(c("lower2", "value", "upper2"), label = "num2")
MLavoie
  • 9,671
  • 41
  • 36
  • 56