【问题标题】:resizing Flex dashboard gauge within a shiny app在闪亮的应用程序中调整 Flex 仪表板仪表的大小
【发布时间】:2018-08-31 23:23:56
【问题描述】:

有没有办法让我的闪亮应用中的 flexdashboard 仪表盘更大?

我尝试更改 UI 中的宽度和高度,但这只是在仪表板上移动它。它不会让它变大。

library(shiny)
library(flexdashboard)

fluidRow(column(
         width =  12,
           gaugeOutput('Scale', width = "800px", height = "400px")
       )
)

【问题讨论】:

  • 我也有同样的问题

标签: r shiny flexdashboard


【解决方案1】:

你的意思是这样的吗?

只是使用一些简单的 css。

library(shiny)
library(flexdashboard)

css <- HTML("
.html-widget.gauge svg {
  height: 400px;
  width: 800px;
}")

ui <- fluidPage(
  tags$head(tags$style(css)),
  fluidRow(column(
    width =  12,
    gaugeOutput('Scale')
  )
  )
)

server <- function(input, output, session) {
  output$Scale <- renderGauge({
    gauge(56, min = 0, max = 100, symbol = '%', label = paste("Test Label"),gaugeSectors(
      success = c(100, 6), warning = c(5,1), danger = c(0, 1), colors = c("#CC6699")
    ))
  })
}

shinyApp(ui, server)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-22
    • 1970-01-01
    • 2020-09-26
    • 2017-05-21
    • 1970-01-01
    • 2019-02-12
    • 2016-05-02
    • 1970-01-01
    相关资源
    最近更新 更多