facet shiny examples
This commit is contained in:
parent
3d55188a00
commit
1aac748555
|
@ -327,7 +327,7 @@ build_facet_tag <- function(x) {
|
|||
#' @importFrom shiny uiOutput
|
||||
#' @importFrom htmlwidgets getDependency
|
||||
#'
|
||||
#' @example examples/facet-shiny.R
|
||||
#' @example examples/facet-wrap-shiny.R
|
||||
apexfacetOutput <- function(outputId) {
|
||||
tagList(
|
||||
uiOutput(outputId = outputId),
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
library(shiny)
|
||||
library(apexcharter)
|
||||
|
||||
data("economics_long", package = "ggplot2")
|
||||
|
||||
|
||||
ui <- fluidPage(
|
||||
|
||||
tags$h2("Apexcharts Facets Example"),
|
||||
|
||||
apexfacetOutput("myfacet")
|
||||
|
||||
)
|
||||
|
||||
server <- function(input, output, session) {
|
||||
|
||||
output$myfacet <- renderApexfacet({
|
||||
apex(economics_long, aes(date, value), type = "line") %>%
|
||||
ax_yaxis(tickAmount = 5) %>%
|
||||
ax_facet_grid(vars(variable), scales = "free", chart_height = "200px")
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (interactive())
|
||||
shinyApp(ui, server)
|
Loading…
Reference in New Issue