2015-10-13 68 views
2

我为我的应用程序使用闪亮的仪表板包。 ,同时尝试在同一页面上显示2个图(每个在一个框中),它们重叠。 还试图用fluidRow每个情节 - 但仍然看起来既情节都连接到同一盒(和重叠)闪亮的仪表板多个图表 - 重叠

这是我的代码:

mainPanel(
    fluidRow( 
    box(showOutput("MeasuresPlot","morris"),width=6,title="Graph"), 
    box(showOutput("ImportPlot","morris"),width=6,title="Graph2") 
    )  
) 

回答

3

你的差不多了,你的液体排内可以使用的列是这样的:

library(shiny) 
library(shinydashboard) 


ui <-dashboardPage(
    dashboardHeader(), 
    dashboardSidebar(), 
    dashboardBody(
     fluidRow(
     column(6,box(plotOutput("plt1"),width=12,title="Graph",background ="green")), 
     column(6,box(plotOutput("plt2"),width=12,title="Graph2",background="yellow")) 
    ), 
     fluidRow(actionButton("plot","plot")) 
    ) 
) 

server <- shinyServer(function(input, output, session) { 
    observeEvent(input$plot,{ 
    output$plt1 <- renderPlot({plot(runif(100),runif(100))}) 
    output$plt2 <- renderPlot({plot(runif(100),runif(100))}) 
    }) 
}) 

shinyApp(ui = ui, server = server) 

一个fluidRow的最大宽度为12,从而设置每个柱具有宽度6给出了2个相等的宽度图。

相关问题