data("EuStockMarkets") stock <- as.data.frame(EuStockMarkets) %>% gather(index,price) %>% mutate(time = rep(time(EuStockMarkets), 4)) plot_ly(stock, x = ~time, y = ~price, color = ~index, type = "scatter", mode = "lines")