R 如何让我的柱状图在不拥挤的情况下呈现在我闪亮的应用程序中?

R 如何让我的柱状图在不拥挤的情况下呈现在我闪亮的应用程序中?,r,ggplot2,plot,shiny,R,Ggplot2,Plot,Shiny,我有一个闪亮的应用程序,正在呈现一个拥挤的柱状图 如何允许垂直向下滚动图表以查看所有条形图和标签?我有7000个标签。我生成图表的代码如下: plot_cost <- function(){ segments <- segment_data %>% filter(District %in% input$district) %>% ggplot(aes(x = reorder(Segments, Impr

我有一个闪亮的应用程序,正在呈现一个拥挤的柱状图

如何允许垂直向下滚动图表以查看所有条形图和标签?我有7000个标签。我生成图表的代码如下:

plot_cost <- function(){
        segments <- segment_data %>% 
            filter(District %in% input$district) %>% 
            ggplot(aes(x = reorder(Segments, Improvement_Cost), y = Improvement_Cost, fill = Segments)) +
            geom_col() +
            #theme(axis.text.x = element_text(angle = 30, hjust = 1, vjust = 1)) +
            coord_flip()
tabPanel('Graph', icon = icon("fas fa-chart-bar"),
                         
                         plotlyOutput('costs', height = "100%"))

我想试试这样的东西:

div(
  style = "overflow-y: scroll; height: 400px;",
  plotlyOutput('costs', height = "1000px")
)