Как я могу сделать график серии с высокой чартера в блестящей коробке? - PullRequest
0 голосов
/ 22 февраля 2019

Как сделать блестящий график временных рядов с высокими значениями в поле?Я пытаюсь сделать такой же график в блестящем.Кто-нибудь знает как?

Image1

Сайт: http://www.piaschile.cl/mercado/benchmarking-internacional/

1 Ответ

0 голосов
/ 23 февраля 2019

Вы можете начать с примера блестящего приложения

library("shiny")
library("highcharter")

data(citytemp)

ui <- fluidPage(
  h1("Highcharter Demo"),
  fluidRow(
    column(width = 4, class = "panel",
           selectInput("type", label = "Type", width = "100%",
                       choices = c("line", "column", "bar", "spline")), 
           selectInput("stacked", label = "Stacked",  width = "100%",
                       choices = c(FALSE, "normal", "percent")),
           selectInput("theme", label = "Theme",  width = "100%",
                       choices = c(FALSE, "fivethirtyeight", "economist",
                                   "darkunica", "gridlight", "sandsignika",
                                   "null", "handdrwran", "chalk")
           )
    ),
    column(width = 8,
           highchartOutput("hcontainer",height = "500px")
    )
  )
)

server = function(input, output) {

  output$hcontainer <- renderHighchart({

    hc <- hc_demo() %>%
      hc_rm_series("Berlin") %>% 
      hc_chart(type = input$type)

    if (input$stacked != FALSE) {
      hc <- hc %>%
        hc_plotOptions(series = list(stacking = input$stacked))
    }

    if (input$theme != FALSE) {
      theme <- switch(input$theme,
                      null = hc_theme_null(),
                      darkunica = hc_theme_darkunica(),
                      gridlight = hc_theme_gridlight(),
                      sandsignika = hc_theme_sandsignika(),
                      fivethirtyeight = hc_theme_538(),
                      economist = hc_theme_economist(),
                      chalk = hc_theme_chalk(),
                      handdrwran = hc_theme_handdrawn()
      )

      hc <- hc %>% hc_add_theme(theme)

    }

    hc

  })

}

shinyApp(ui = ui, server = server)

Вы также можете обратиться к следующим ссылкам, чтобы начать с:

https://datascienceplus.com/making-a-shiny-dashboard-using-highcharter-analyzing-inflation-rates/

http://jkunst.com/highcharter/shiny.html

...