【发布时间】:2015-06-03 06:43:34
【问题描述】:
我正在尝试使用 NVD3 图表,虽然它在闪亮的仪表板中正确呈现,但包含图表的 div 溢出闪亮的仪表板box() 容器(不适合紧贴盒子)。显式设置图表的高度和宽度会改变图表的大小,但不会改变包含的 div,它会继续溢出 box 容器;我似乎无法控制 div 的大小?代码如下:
app.R
library(shiny)
library(shinydashboard)
library(rCharts)
library(curl)
consent <- read.csv(curl("https://raw.githubusercontent.com/kilimba/data/master/consent.csv"))
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(),
dashboardBody(
fluidRow(
box(showOutput("distPlot2"),width = 6)
)
)
)
server <- function(input, output) {
output$distPlot2 <- renderChart2({
p2 <- nPlot(HIVConsentRate ~ Year,
group = 'HIVRefused',
data = consent,
type = 'stackedAreaChart',
height = 250,
width = 450)
return(p2)
})
}
shinyApp(ui, server)
任何帮助表示赞赏, 图马尼
【问题讨论】: