有没有办法以这样的方式显示dateRangeInput()
小部件的两个输入字段,而不是并排排列,它们像堆栈一样垂直排列,即start = <date>
on end = <date>
的顶部?
我查看了shiny
文档但找不到完成此操作的方法,而且我还没有那么擅长CSS / Javascript(还)。
提前致谢。
更新:
为了澄清,这是我的应用程序的片段:
app <- shinyApp(
ui = fluidPage(
sidebarLayout(
sidebarPanel(
width = 3,
# --- code based on selectInput() with choices linking to conditional panels ---
tags$div(title = "Request data for a given time period",
conditionalPanel(
condition = "input.outputstyle == 'Density plot (week)'",
dateRangeInput("daterange",
label = "Date Range: ",
start = Sys.Date() - 8,
end = Sys.Date() - 1,
max = Sys.Date(),
format = "d M",
separator = "--"))),
# --- more code for other conditional panels, etc. ---
server = function(input, output) {
# rest of code
}
)
答案 0 :(得分:2)
fluidRow(column(width = 12,dateInput("daterange1", "Date range:", start = "2001-01-01")),
column(width = 12,dateInput("daterange2", "Date range:", end = "2017-01-01")))
您可以使用Shiny的dateInput()小部件执行此操作。
将宽度更改为12可以叠加它。