【问题标题】:Shinydashboard + dygraph + valueBoxShinydashboard + dygraph + valueBox
【发布时间】:2016-12-11 23:09:03
【问题描述】:

shinydashboard 中的 dygraph 和 valueBox 之间存在一些不兼容?为什么不绘制 ValueBox?有人可以帮我吗?

## app.R ##
library(shiny)
library(shinydashboard)
library(dygraphs)


ui <- dashboardPage(
  dashboardHeader(title = "Monitoramento Banco de Dados"),         
  dashboardSidebar(
    sliderInput("DateInput", "Periodo", -30, 0, c(-15, 0), pre = "D.")
  ),
  dashboardBody(
            fluidRow(     
                valueBoxOutput("box_Locks"),
                valueBoxOutput("box_PLE"),
                valueBoxOutput("box_CPU")
              ),
            fluidRow(
                 dygraphOutput("plot1")
            )
       )
)

server <- function(input, output) {

 output$box_Locks <- renderValueBox({
    valueBox("7", "Locks", icon = icon("area-chart"), color = "yellow")
  })

  output$box_PLE <- renderValueBox({
    valueBox("1500", "PLE", icon = icon("area-chart"), color = "green")
  })

  output$box_CPU <- renderValueBox({
    valueBox(paste0(20, "%"), "CPU", icon = icon("area-chart"), color = "red")
  })

  output$plot1 <- renderDygraph({
    lungDeaths <- cbind(ldeaths, mdeaths, fdeaths)
    dyRangeSelector(dygraph(lungDeaths, main = "Deaths from Lung Disease (UK)"), dateWindow = c("1974-01-01", "1980-01-01"))
  }) 




}

shinyApp(ui, server)

版本:

> R.version.string
[1] "R version 3.3.1 (2016-06-21)"
> packageVersion("shiny")
[1] ‘0.13.2’
> packageVersion("shinydashboard")
[1] ‘0.5.1’
> packageVersion("dygraphs")
[1] ‘1.1.1.0’

这是结果,我不知道为什么不显示值 Box :

【问题讨论】:

    标签: r shiny shinydashboard


    【解决方案1】:

    这方面一切正常:

    更新您的软件包。查看我的会话信息,祝你好运。

    sessionInfo()

    R version 3.3.1 (2016-06-21)
    Platform: x86_64-w64-mingw32/x64 (64-bit)
    Running under: Windows 7 x64 
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    other attached packages:
    [1] dygraphs_1.1.1-1     shinydashboard_0.5.3 shiny_0.13.2        
    [4] ggplot2_2.1.0   
    

    【讨论】:

      猜你喜欢
      • 2017-03-31
      • 2016-05-27
      • 2015-08-28
      • 2020-08-08
      • 2022-11-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-05
      相关资源
      最近更新 更多