Plot_ly example
library(plotly) 
today <- Sys.Date() 
tm <- seq(0, 600, by = 10) 
x <- today - tm y <- rnorm(length(x)) 
p <- plot_ly(x = ~x, y = ~y, mode = 'lines', text = paste(tm, "days from today"))
Find the complete example here,
https://plot.ly/r/time-series/