2016-05-25 8 views
0

私は光沢のあるアプリケーションを持っています。ここでは、ユーザーが選択するグラフの上にチェックボックスを表示しようとしています。現在、チェックボックスはタイトルの下に表示されていますが、左側にタイトルが、右側にチェックボックスが同じ行に表示されます。私はそれがCSSを記録することによって達成できると確信していますが、方法はわかりません。checkboxInputと光沢のあるボックスタイトルを合わせる

library(shiny) 
library(shinydashboard) 

ui <- dashboardPage(
    dashboardHeader(
     title = "MODULE",titleWidth = 225 
    ), 
    dashboardSidebar(
     width = 225, 
     sidebarMenu(id = "tabs", 
        menuItem("TOPLINES", tabName = "tplines", icon = shiny::icon("dashboard")) 
     )), 
    dashboardBody(
     tabItems(
      tabItem(
       tabName = "tplines", 
       fluidRow(
        box(
         checkboxInput(inputId = "inventorytop8metrocheck", "Add to reports", value = FALSE), 
         width = 6, status = "info", title = "Inventory information", 
         div(plotlyOutput("inventorytop8metro"), width = "100%", height = "400px", style = "font-size:80%;") 
        ) 
        ))))) 

server <- function(session,input,output){ 

} 

shinyApp(ui,server) 

答えて

1

をたぶんあなただけのcolumnsと標準行のパーティションを探しています:以下のように現在のコードが見えます。タイトルの引数は任意の要素を取るので、元のタイトルの半分とチェックボックス入力の半分の行を入力します。したがって、それらは並んでいます。もちろん、チェックボックスはタイトルと同じスタイルです。必要がない場合は、チェックボックスの列にstyleパラメータを設定してスタイルを変更できます。

library(shiny) 
library(shinydashboard) 
library(plotly) 

ui <- dashboardPage(
    dashboardHeader(
    title = "MODULE",titleWidth = 225 
), 
    dashboardSidebar(
    width = 225, 
    sidebarMenu(id = "tabs", 
     menuItem("TOPLINES", tabName = "tplines", icon = shiny::icon("dashboard")) 
)), 
    dashboardBody(
    tabItems(
     tabItem(
     tabName = "tplines", 
     fluidRow(
      box(
      width = 6, status = "info", title = fluidRow(
       column(6, "Inventory information"), 
       column(6, checkboxInput(inputId = "inventorytop8metrocheck", "Add to reports", value = FALSE)) 
      ), 
      div(plotlyOutput("inventorytop8metro"), width = "100%", height = "400px", style = "font-size:80%;") 
     ) 
     ) 
    ) 
    ) 
) 
) 

server <- function(session,input,output){} 

shinyApp(ui,server) 
+0

タイトルを複数の列に分割することはできませんでした...新しいスタイルの引数の提案が助けになりました。 – Apricot

関連する問題