Description Usage Arguments Examples
Update a chart.
1 |
c |
A proxy for a chart as returned by |
duration |
Time for the animation of the redraw in milliseconds. |
lazy |
If |
easing |
The animation easing function. See Animation Easing for possible values. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | library(shiny)
ui <- fluidPage(
actionButton("add", "Add z serie"),
actionButton("update", "Update chart"),
charterOutput("chart")
)
server <- function(input, output){
df <- data.frame(
x = 1:100,
y = runif(100),
z = runif(100)
)
output$chart <- render_charter({
chart(df, caes(x, y)) %>%
c_scatter()
})
observeEvent(input$add, {
charter_proxy("chart") %>%
c_line(data = df, caes(x, z), update = FALSE)
})
observeEvent(input$update, {
charter_proxy("chart") %>%
c_update()
})
}
if(interactive())
shinyApp(ui, server)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.