apexcharter/examples/facet-grid-shiny.R

28 lines
497 B
R
Raw Permalink Normal View History

2020-12-08 14:49:16 +01:00
library(shiny)
library(apexcharter)
2021-01-06 11:34:27 +01:00
data("economics_long", package = "ggplot2")
2020-12-08 14:49:16 +01:00
ui <- fluidPage(
tags$h2("Apexcharts Facets Example"),
apexfacetOutput("myfacet")
)
server <- function(input, output, session) {
output$myfacet <- renderApexfacet({
2021-01-06 11:34:27 +01:00
apex(economics_long, aes(date, value), type = "line") %>%
2020-12-08 14:49:16 +01:00
ax_yaxis(tickAmount = 5) %>%
2021-01-06 11:34:27 +01:00
ax_facet_grid(vars(variable), scales = "free", chart_height = "200px")
2020-12-08 14:49:16 +01:00
})
}
2020-12-08 16:22:24 +01:00
if (interactive())
shinyApp(ui, server)