我在闪亮中的用户界面有点问题。我需要将dashboardBody分成两行。
第一行由2列划分。一个有一个图,另一个有两个图,每一个都在一行中。
第二行由3列划分,每列都有一个infoBox。
这是我的代码:
dashboardPage(skin = 'green',
dashboardHeader(title = 'Zanity - Análise de Dados e Consultoria', titleWidth = 400),
dashboardSidebar(width = 400),
dashboardBody(
box(title = 'Weekly revenue', plotlyOutput('plot_revenue')),
box(title = 'Loading %', plotlyOutput('plot_porc_loading')),
box(title = 'Manufacture', plotly('plot_manu')),
fluidRow(
infoBox('Ex. Load', 200, icon = icon('weight')),
infoBox('Loading %', '0.97%', icon = icon('percent')),
infoBox('Revenue', 'R$ 60.000,00', icon = icon('dollar-sign'))
)
)
)这是我想要的样子:
发布于 2020-02-07 02:11:13
如下所示:诀窍是首先将所有内容划分为fluidRow(),然后深入研究column()中的每一行,并理解每一列都有一个width = 12,即使该行中的列没有。
library(shiny)
library(shinydashboard)
ui <- dashboardPage(skin = 'green',
dashboardHeader(title = 'Zanity - Análise de Dados e Consultoria', titleWidth = 400),
dashboardSidebar(width = 400),
dashboardBody(
#First Row:
fluidRow(
column(6,
box(title = 'Weekly revenue', width = 12)
),
column(6,
box(title = 'Loading %', width = 12),
box(title = 'Manufacture', width = 12)
)
),
#Second Row:
fluidRow(
infoBox('Ex. Load', 200, icon = icon('weight')),
infoBox('Loading %', '0.97%', icon = icon('percent')),
infoBox('Revenue', 'R$ 60.000,00', icon = icon('dollar-sign'))
)
)
)
server <- function(input, output) { }
shinyApp(ui, server)https://stackoverflow.com/questions/60100136
复制相似问题