我製作了一個應用程序,您需要選擇一個日期。當您使用日期選擇器時,它將顯示在菜單欄後面,並隱藏重要信息。閃亮的日期選取器在菜單欄下方打開
你可以看到日期選取器的頂線,並可以看到這一個月你在和月之間快速瀏覽。
現在,如果日期放在低一點,菜單欄將隱藏的日期選擇器的頂部,並出現像這樣的:
我怎樣才能避免這種情況?我已經添加,其複製與第二日期選擇下面
# Setup
library(shiny)
library(dplyr)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(title = "Basic dashboard"),
## Sidebar content
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
menuItem("Widgets", tabName = "widgets", icon = icon("th")),
dateRangeInput('dateRange1',
label = 'Period 1, Current Month',
start = Sys.Date(), end = Sys.Date() + 9,
separator = ";",
weekstart = 1), # This opens correct
dateRangeInput('dateRange1',
label = 'Period 1, Current Month',
start = Sys.Date(), end = Sys.Date() + 9,
separator = ";",
weekstart = 1) # This does NOT open correct!
)
),
dashboardBody(
tabItems(
# First tab content
tabItem(tabName = "dashboard",
fluidRow(
box(plotOutput("plot1", height = 250)),
box(
title = "Controls",
sliderInput("slider", "Number of observations:", 1, 100, 50)
)
)
),
# Second tab content
tabItem(tabName = "widgets",
h2("Widgets tab content")
)
)
)
)
server <- function(input, output) {
set.seed(122)
histdata <- rnorm(500)
output$plot1 <- renderPlot({
data <- histdata[seq_len(input$slider)]
hist(data)
})
}
shinyApp(ui, server)
經過思考我可能有誤讀您的問題。我以爲你想要一個解決方案,即將datepicker-orient-bottom應用於這兩個對象的類。請忽略。 :) – LuckySeedling