【发布时间】:2018-02-03 05:15:25
【问题描述】:
我正在尝试使用flexdashboard::gauge,但它始终是相同的大小(不缩放)并且我不知道如何更改它的大小。我知道有一种方法可以使用renderPlot 并设置例如height 来处理普通绘图。有没有办法用 renderGauge 做类似的事情?
这是我的代码:
---
title: "Test"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
library(googleVis)
```
Column {.sidebar}
-----------------------------------------------------------------------
```{r}
selectInput("n", label = "Number of bins:",
choices = c(10, 20, 35, 50), selected = 20)
```
Column {data-width=500}
-----------------------------------------------------------------------
### Gauge
```{r}
renderGauge({
invalidateLater(1000, session)
dane <- round(runif(1,0,100))
df <- data.frame(Label = "IRR", Value = as.numeric(dane))
gauge(dane, min = 0, max = 100, symbol = '%', gaugeSectors(
success = c(80, 100), warning = c(40, 79), danger = c(0, 39)
))
})
```
### Chart A
```{r }
renderPlot({
plot(1:10,1:10)
})
```
Column {data-width=500}
-----------------------------------------------------------------------
### Chart B
```{r}
renderPlot({
plot(1:10,1:10)
})
```
### Chart C
```{r}
renderPlot({
plot(1:10,1:10)
})
```
其余的图表将填补这个位置。 你知道怎么把这个量规变大吗? 谢谢!
【问题讨论】:
标签: r shiny scaling gauge flexdashboard