I'm writing a shiny app with highcharter.
In my app I would like to add an independant button to view my chart in full screen.
I think I have to add JS code with the button "action_fs" in my example... Here's my app:
library(shiny)
library(dplyr)
library(highcharter)
ui <- fluidPage(
fluidRow(
actionButton("mybutton","launch"),
br(),
column(width = 6,
uiOutput("button_fullscreen"),
highchartOutput("mygraph")
)
)
)
server = function(input, output) {
mytab <- iris %>% group_by(Species) %>% summarise(mystat=sum(Petal.Length,na.rm = T))
observeEvent(input$mybutton, {
output$button_fullscreen <- renderUI({
actionButton("action_fs","view in full screen")
})
output$mygraph <- renderHighchart({
highchart() %>%
hc_chart(type = "bar") %>%
hc_add_series(data = mytab$mystat, name = "Petal.Length") %>%
hc_xAxis(categories = mytab$Species)
})
})
}
shinyApp(ui = ui, server = server)