我很有光泽.我想为滑动条提供静态颜色,而不管在闪亮的仪表板中选择的范围.我希望滑块有不同的颜色如下,例如:0到40 - 红色,40到60 - 蓝色,60到100 - 绿色.请帮我解决这个问题.我的代码,
library(shiny)
library(shinydashboard)
ui <- dashboardPage(skin = "black",
dashboardHeader(title = "test"),
dashboardSidebar(
sidebarMenu(
menuItem("Complete", tabName = "comp"))),
dashboardBody(
tabItems(
tabItem(tabName = "comp",
fluidRow(
sliderInput("range_var", "", value = c(90,100), min = 0, max = 100, width = '200%'))))))
server <- function(input, output, session) {
observe({
updateSliderInput(session, "range_var", label = "", value = c(90, 100), min = 0, max = 100)
})
}
shinyApp(ui, server)
Run Code Online (Sandbox Code Playgroud)
谢谢Balaji
我在 Power BI 中为 7 个仪表板安排了一天 8 次刷新。但我发现其中一个仪表板没有更新其值。该特定仪表板仅在单击立即刷新选项时刷新。此外,计划刷新选项每天都会自动禁用。
我想使用 flexdashboard 包在我闪亮的仪表板中显示值框。请检查我的代码,未显示值框。请帮助我解决这个问题。
用户界面代码
library(shiny)
library(shinydashboard)
library(flexdashboard)
ui <- dashboardPage(skin = "black",
dashboardHeader(title = "test"),
dashboardSidebar(
sidebarMenu()),
dashboardBody(
fluidRow(
valueBoxOutput("vbox1", width = 2),
valueBoxOutput("vbox2", width = 2),
valueBoxOutput("vbox3", width = 2),
valueBoxOutput("vbox4", width = 2),
valueBoxOutput("vbox5", width = 2),
valueBoxOutput("vbox6", width = 2))))
Run Code Online (Sandbox Code Playgroud)
服务器代码
server <- function(input, output) {
#valuebox
output$vbox1 <- renderValueBox({
d <- 10
valueBox( d, caption = "Coss")
})
output$vbox2 <- renderValueBox({
d <- 42
valueBox( d,"Ccy")
})
output$vbox3 <- renderValueBox({
d <- 75
valueBox( d,"Cty")})
output$vbox4 …Run Code Online (Sandbox Code Playgroud)