微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

信息框不与 Shiny 中的服务器通信

如何解决信息框不与 Shiny 中的服务器通信

我正在制作一个闪亮的仪表板。但是当使用 infoBoxOutput 时,我的仪表板似乎没有与服务器通信。它甚至没有出现。有人可以查看以下代码并在此处告诉我问题。

如果我只是简单地使用 InfoBox,它会打印 info_Box1 但不与服务器通信。使用 infoBoxOutput 时,即使它没有显示在仪表板正文中。

library(shiny)
library(shinydashboard)
library(shinyjs)

source("D:/Upwork/MAL/3rd-Data Visualization/RCodes/MalServer.R")

shinyUI <-
  dashboardPage( title="Demo App",dashboardHeader(title="Covid-19 Death Analysis",dropdownMenuOutput("msgOutput")
                    # dropdownMenu(type="message",#              messageItem(from="Finance Update",message = "We are on threshold"),#              messageItem(from = "Sales Update",message = "Sales are at 55%",icon=icon("bar-chart"),time="22:00"),#              messageItem(from="Sales Update",message = "Sales meeting at 6 PM on Monday",icon=icon("handshake-o"),time="03-22-2021")
                    #              )
                    
                    ),dashboardSidebar( width =320,useShinyjs(),sidebarMenu(
        width = 2,daterangeInput('daterange',label = 'Filter crimes by date',start = as.Date('2019-01-01'),end = as.Date('2021-06-01')),selectInput("var",label = "1. Select the quantitative Variable",choices = c("place_of_death"=3,"Month Name"=11,"cause_of_death"=8),selected = 8),radioButtons( "dist","Enable or disable Grouping:",c("Enable" = "enable","disable" = "disable" ),inline=T),selectInput("var2",choices = c("cause_of_death"=8,"year"=7),selected = 7),radioButtons( "CauSEOfDeathRad",c("Covid" = "covid","Non-Covid" = "nonCovid","Both" = "both"),radioButtons( "DeathonYearRad",c(
                        "2020" = "2020","2021" = "2021","All" = "All"),inline=T)
      
      
    )),dashboardBody(
      
      useShinyjs(),#Second Row:
      
        infoBoxOutput('info_Box1'),infoBox('Loading %','0.97%',icon = icon('percent')),infoBox('Revenue','R$ 60.000,00',icon = icon('dollar-sign')),tabsetPanel(
        #tabPanel("Plot",plotOutput("myhist")),tabPanel("Plot2",plotOutput("myhist2")) 
      )
      
      

    )
    )
 

shinyServer <- function(input,output ) {
  
  
  output$info_Box1 <- renderInfoBox({
    infoBox("Amount in Total here",sum(mydf$Amount))
  })

}

shinyApp(shinyUI,shinyServer)

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。