HI Пожалуйста, предоставьте минимальный воспроизводимый код, чтобы он помог воспроизвести проблему. Это вопрос о том, как вы устроите свой пользовательский интерфейс, как жидкость и столбец. Я попытался с тем же и построить пример кода на этом.
[![library(shiny)
library(shinydashboard)
library(plotly)
ui <- dashboardPage(
dashboardHeader(
title = "Dashboard"),
#sidebar content
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard"))
)
),
dashboardBody(
tabItems(
tabItem(tabName='dashboard',
tabBox(width = 12,
tabPanel("US County Detail",
fluidRow(
column(5,
fluidRow(
tableOutput("County_tbl")
)
),
column(7,
fluidRow(
column(6,
uiOutput("States_List")
),
column(6,
sliderInput("slider", "Threshold:", 0, 100, post = " %", 50)
)
),
fluidRow(
column(12,
plotlyOutput("County_Map")
)
),
fluidRow(
column(12,
plotlyOutput("County_Chart")
)
)
)
)
)
)
)
)
)
)
server <- function(input, output,session) {
output$County_tbl<-renderTable({
head(mtcars)
})
output$States_List<-renderUI({
list_data<-unique(names(mtcars))
selectInput("cars","Select Car",choices = list_data)
})
output$County_Map<-renderPlotly({
plot_ly(
x = c("giraffes", "orangutans", "monkeys"),
y = c(20, 14, 23),
name = "SF Zoo",
type = "bar"
)
})
output$County_Chart<-renderPlotly({
Animals <- c("giraffes", "orangutans", "monkeys")
SF_Zoo <- c(20, 14, 23)
LA_Zoo <- c(12, 18, 29)
data <- data.frame(Animals, SF_Zoo, LA_Zoo)
plot_ly(data, x = ~Animals, y = ~SF_Zoo, type = 'bar', name = 'SF Zoo') %>%
add_trace(y = ~LA_Zoo, name = 'LA Zoo') %>%
layout(yaxis = list(title = 'Count'), barmode = 'group')
})
}
shinyApp(ui = ui, server = server)
![enter image description here](https://i.stack.imgur.com/8FDKV.png)