setCustomTime | R Documentation |
Adjust the time of a custom time bar
setCustomTime(id, time, itemId)
id |
Timeline id or a |
time |
The new date/time |
itemId |
The id of the custom time bar |
## Not run: timevis() %>% addCustomTime(Sys.Date(), "yesterday") %>% setCustomTime(Sys.Date() - 1, "yesterday") ## End(Not run) if (interactive()) { library(shiny) shinyApp( ui = fluidPage( timevisOutput("timeline"), actionButton("btn", "Set time bar 24 hours ago") ), server = function(input, output) { output$timeline <- renderTimevis( timevis() %>% addCustomTime(Sys.Date(), "yesterday") ) observeEvent(input$btn, { setCustomTime("timeline", Sys.Date() - 1, "yesterday") }) } ) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.