当屏幕最大化时,集成在闪亮仪表板中的Plotly graph的大小和比例将发生变化
我正在将一个绘图仪集成到闪亮的仪表板中。但是,图形的大小和比例将在最大化屏幕后更改为,或者将UI拖动到具有不同分辨率的屏幕上 Blow是我想要的图形的屏幕截图: Blow是最大化屏幕后的图形截图: 下面是我的代码:当屏幕最大化时,集成在闪亮仪表板中的Plotly graph的大小和比例将发生变化,r,ggplot2,shiny,plotly,r-plotly,R,Ggplot2,Shiny,Plotly,R Plotly,我正在将一个绘图仪集成到闪亮的仪表板中。但是,图形的大小和比例将在最大化屏幕后更改为,或者将UI拖动到具有不同分辨率的屏幕上 Blow是我想要的图形的屏幕截图: Blow是最大化屏幕后的图形截图: 下面是我的代码: header <- dashboardHeader( ) sidebar <- dashboardSidebar( ) body <- dashboardBody( box(title = "Test", plotlyOutput("plo
header <- dashboardHeader(
)
sidebar <- dashboardSidebar(
)
body <- dashboardBody(
box(title = "Test",
plotlyOutput("plot")
)
)
ui <- dashboardPage(header, sidebar, body)
server <- function(input, output) {
output$plot <- renderPlotly({
plot_ly(x = b1image$CNT, y = b1image$Label, type = 'bar', orientation = 'h',
marker = list(color = viridis::viridis_pal(option = "C", direction =1)(max(b1image$Label) - min(b1image$Label) + 3)))
})
}
shinyApp(ui, server)
header也许这可以帮助您:
header <- dashboardHeader(
)
sidebar <- dashboardSidebar(
)
body <- dashboardBody(
box(title = "Test", width = 10, height = "500px",
plotlyOutput("plot",width = "400px", height = "400px")
)
)
ui <- dashboardPage(header, sidebar, body)
server <- function(input, output) {
output$plot <- renderPlotly({
server <- function(input, output) {
output$plot <- renderPlotly({
p <- plot_ly()
p <- add_trace(p, x=a, y=b, z=c, mode="markers", type="scatter3d", marker = list(size = 5, color = 'rgba(0, 0, 0, 1)'))
p <- layout(p, scene = list(xaxis = list(title = "A",range = c(-2,2)), yaxis = list(title = "B",range = c(-2,2)), zaxis = list(title = "C",range = c(-2,2))))
p
})
}
shinyApp(ui, server)
})
}
shinyApp(ui, server)
box(title = "Test", width = 10, height = "500px",
plotlyOutput("plot",width = "400px", height = "400px")
)
标题