library(shiny)library(shinydashboard)ui <- dashboardPage( dashboardHeader(title = "BT Campaign"), dashboardSidebar( menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")), menuItem("Widgets", icon = icon("th"), tabName = "widgets", badgeLabel = "new", badgeColor = "green"), sidebarSearchForm(textId = "searchText", buttonId = "searchButton", label = "Search..."), sliderInput("slider", "Slider input:", 1, 100, 50) ), dashboardBody( fluidRow( # A static valueBox valueBox(7961, "Total Leads", icon = icon("credit-card")), # Dynamic valueBoxes valueBoxOutput("progressBox"), valueBoxOutput("approvalBox") ), fluidRow( valueBox("Performance", "", color = "blue", width = 250) ), fluidRow( tabBox( title = "Channel Performance", width = 4, # The id lets us use input$tabset1 on the server to find the current tab id = "tabset1", tabPanel("Tab1", plotOutput("plot1", height = 250)), tabPanel("Tab2", "Tab content 2") #title = "Channel Performance", status = "primary", solidHeader = TRUE, width = 4, #collapsible = TRUE, #plotOutput("plot1", height = 250) ), box( title = "Card Type", status = "warning", solidHeader = TRUE, width = 4, collapsible = TRUE, plotOutput("plot2", height = 250) ), box( title = "Response Model", status = "warning", solidHeader = TRUE, width = 4, collapsible = TRUE, plotOutput("plot3", height = 250) ) # Clicking this will increment the progress amount #box(width = 4, actionButton("count", "Increment progress")) ) ))server <- function(input, output) { # output$progressBox <- renderValueBox({ # valueBox( # paste0(25 + input$count, "%"), "Progress", icon = icon("list"), # color = "purple" # ) # }) output$progressBox <- renderValueBox({ valueBox( "148", "Responders", icon = icon("list"), color = "purple") }) output$approvalBox <- renderValueBox({ valueBox( "$1.14", "Balance Transfers", icon = icon("thumbs-up", lib = "glyphicon"), color = "yellow" ) }) output$plot1 <- renderPlot({ data <- histdata[seq_len(input$slider)] hist(data) }) output$plot2 <- renderPlot({ data <- histdata[seq_len(input$slider)] hist(data) }) output$plot3 <- renderPlot({ data <- histdata[seq_len(input$slider)] hist(data) })}shinyApp(ui, server)