rstudio / dygraphs

R interface to dygraphs
http://rstudio.github.io/dygraphs
Other
364 stars 194 forks source link

no visible graph using useDataTimezone #221

Open echaintreau opened 5 years ago

echaintreau commented 5 years ago

Hi,

Impossible to use the option useDataTimezone, the output is an empty graph for exemple

library(xts)
library(dygraphs)

test <- xts(x = c(1:5),order.by = Sys.time()-60*c(1:5))
test2 <- test
indexTZ(test2)<-'UTC'

dyOptions(dygraph = dygraph(test),useDataTimezone = TRUE) #work 

dyOptions(dygraph = dygraph(test2),useDataTimezone = TRUE) #not working
echaintreau commented 5 years ago

however if you do

library(xts)
library(dygraphs)

test2 <- xts(x = c(1:5),order.by = Sys.time()-60*c(1:5),tzone='UTC')

dyOptions(dygraph = dygraph(test2),useDataTimezone = TRUE) #work

it work strange