【问题标题】:How do I get my column chart to render without crowding in my shiny app?如何让我的柱形图呈现在我闪亮的应用程序中而不拥挤?
【发布时间】:2021-07-18 21:08:18
【问题描述】:

我有一个 Shiny 应用程序正在渲染一个拥挤的柱形图

如何允许垂直向下滚动图表以查看所有条形图和标签?我有 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%"))

【问题讨论】:

    标签: r ggplot2 plot shiny


    【解决方案1】:

    我会尝试这样的:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-24
      • 2015-09-04
      • 2023-03-15
      • 1970-01-01
      • 1970-01-01
      • 2020-02-22
      • 2014-09-04
      • 1970-01-01
      相关资源
      最近更新 更多