rangeslider: Add a range slider to the x-axis

Description Usage Arguments Author(s) Examples

View source: R/layout.R

Description

Add a range slider to the x-axis

Usage

1

Arguments

p

plotly object.

start

a start date/value.

end

an end date/value.

...

these arguments are documented here https://plot.ly/r/reference/#layout-xaxis-rangeslider

Author(s)

Carson Sievert

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plot_ly(x = time(USAccDeaths), y = USAccDeaths) %>% 
  add_lines() %>%
  rangeslider()
  
d <- tibble::tibble(
  time = seq(as.Date("2016-01-01"), as.Date("2016-08-31"), by = "days"),
  y = rnorm(seq_along(time))
 )
 
plot_ly(d, x = ~time, y = ~y) %>%
  add_lines() %>%
  rangeslider(d$time[5], d$time[50])
  

plotly documentation built on Nov. 8, 2019, 1:07 a.m.