信息框不与 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 (将#修改为@)