我正在尝试创建一个闪亮的仪表板(R 3.1.0 / shiny 0.12.0 / shinydashboard 0.5.0)。我已成功创建布局,并决定在仪表板侧边栏中使用多个选项卡。
侧边栏由多个选项卡组成,每个选项卡显示一组特定的图到目前为止我所做的简单屏幕截图
我正在尝试为这些图添加一个下载按钮,但我必须将它添加到标题中(以便所有选项卡都可以使用它)。我知道“messageItem”选项,但无法使用它。
有人可以帮忙吗。任何您认为可以的替代方法都是最受欢迎的。
提前致谢
[更新 - 为 UI.R 添加代码] :-
library(shinydashboard)
library(htmlwidgets)
library(rpivotTable)
library(leaflet)
library(ggplot2)
library(rCharts)
library(shiny)
library(data.table)
library(reshape)
library(dplyr)
dashboardPage(
dashboardHeader(title="MSR Reports",
dropdownMenu(type = "task",
messageItem(
from = "Download",
message = "Reports",
icon = icon("gear")
),
messageItem(
"Download",
message = "TEST",
icon = icon("life-ring"),
href= "http://www.google.com"
)
)
),
dashboardSidebar(
sidebarMenu(
menuItem("SRequests", tabName = "SRequests", icon = icon("dashboard")),
menuItem("CRequests", tabName = "CRequests", icon = icon("th")),
menuItem("IN", tabName = "IN", icon = icon("file-word-o")),
menuItem("IN-Map",tabName="IN-Map",icon=icon("file-word-o"))
)),
dashboardBody(
tags$head(tags$style(HTML('
.skin-blue.main-header .logo
{
background-color: #3c8dbc;
}
.skin-blue .main-header .logo:hover
{
background-color: #3c8dbc;
}'))
),
tags$head(tags$style(
type = 'text/css',
'#test{ overflow-x: scroll; }')),
tabItems(
tabItem(tabName = "SRequests",
fluidRow
(
h2("Dashboard",align = "center"),
h3(" "),
h3( " " ),
tabItem(tabName = "SRequests",
column(
div(id="test",rpivotTableOutput('PivotTable',height=520)),width=12
)
)
)),
tabItem(tabName = "CRequests",
fluidRow(
h2("Volume by BA,align = "center"),
h3(" "),
h3(" "),
column(
dataTableOutput("CRequests") , width=10
)
)
),
tabItem(tabName = "IN",
fluidRow(
h2("INDashboard",align = "center"),
h3(" "),
h3(" "),
column(
width=4, showOutput("chart2", "highcharts")
),
column(
width=4, showOutput("chart3", "highcharts")
),
column(
width=4, showOutput("chart4", "highcharts")
)
)
),
tabItem(tabName = "IN-Map",
h2("IN Locations"),
fluidRow(
leafletOutput("mymap"),
actionButton("recalc", "New points")
)
)
)
)
)