2016-08-14 3 views
1

바닥 글과 페이지 중앙의 반짝이는 응용 프로그램 대시 보드에 바닥 글을 넣으려고합니다. 그러나 그것은 몸의 중심에오고 있습니다. 당신은 tagListdashbordPage을 포장 한 후 같은 tags$footer을 배치 할 수 있습니다반짝이는 응용 프로그램 대시 보드의 바닥 글 맞춤

library(shiny) 
library(shinydashboard) 
library(DT) 
library(ggvis) 
library(shiny) 

ui <- dashboardPage(
    dashboardHeader(title = "Dashboard"), 
    dashboardSidebar(sidebarMenu(
    menuItem("Instructions", tabName = "genIns", icon = icon("info-circle")), 
    menuItem("Data", tabName = "data", icon = icon("table")) 

)), 
    dashboardBody(
    tabItems(
     # First tab content 
     tabItem(tabName = "genIns", 
       fluidPage(
       titlePanel("General Instruction will go here")) 
    ), 
     # Second tab content 
     tabItem(tabName = "data", 
       sliderInput("bins", 
          "Number of bins:", 
          min = 1, 
          max = 50, 
          value = 30), 
       plotOutput("distPlot") 
      ) 

    ), 
    tags$footer("My footer", align = "center") 
) 
) 

server.ui

shinyServer(function(input, output, session) { 

    output$distPlot <- renderPlot({ 
    x <- faithful[, 2] # Old Faithful Geyser data 
    bins <- seq(min(x), max(x), length.out = input$bins + 1) 

    # draw the histogram with the specified number of bins 
    hist(x, breaks = bins, col = 'darkgray', border = 'white') 
    }) 
}) 

답변

2

: 또한 내가 페이지 여기

의 하단에 배치 할 수없는 나는 나의 코드 두 번째 인수는 tagList입니다. CSS를 사용하여 바닥 글의 스타일을 추가로 수정할 수도 있습니다.


전체 예 :

library(shiny) 
library(shinydashboard) 
library(DT) 
library(ggvis) 
library(shiny) 

ui <- tagList(
    dashboardPage(
    dashboardHeader(title = "Dashboard"), 
    dashboardSidebar(sidebarMenu(
     menuItem("Instructions", tabName = "genIns", icon = icon("info-circle")), 
     menuItem("Data", tabName = "data", icon = icon("table")) 

    )), 
    dashboardBody(
     tabItems(
     # First tab content 
     tabItem(tabName = "genIns", 
       fluidPage(
        titlePanel("General Instruction will go here")) 
     ), 
     # Second tab content 
     tabItem(tabName = "data", 
       sliderInput("bins", 
          "Number of bins:", 
          min = 1, 
          max = 50, 
          value = 30), 
       plotOutput("distPlot") 
     ) 

    ) 

    ) 

),#end dashboardPage 
    tags$footer("My footer", align = "center", style = " 
       position:absolute; 
       bottom:0; 
       width:100%; 
       height:50px; /* Height of the footer */ 
       color: white; 
       padding: 10px; 
       background-color: black; 
       z-index: 1000;") 

)#end tagList 


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

    output$distPlot <- renderPlot({ 
    x <- faithful[, 2] # Old Faithful Geyser data 
    bins <- seq(min(x), max(x), length.out = input$bins + 1) 

    # draw the histogram with the specified number of bins 
    hist(x, breaks = bins, col = 'darkgray', border = 'white') 
    }) 
}) 

shinyApp(ui, server) 
+0

우리는뿐만 아니라 대시 보드의 사이드 바 이상 바닥 글을 넣을 수 있습니다? – Rajan

+1

물론 바닥 글의 스타일에'z-index : 1000; '을 추가하면 쉽게 할 수 있습니다. 예를 업데이트했습니다. (사이드 바 또한이 속성을 가지고 있으며 810으로 설정되어 있습니다. 그보다 더 큰 숫자를 선택해야했습니다) [여기 Z- 인덱스에 대한 자세한 내용] (http://www.w3schools.com/cssref/pr_pos_z-index.asp) –

+0

하나 더 문제를 업로드했습니다. 도와 주시겠습니까? – Rajan