首页 > 解决方案 > 使用 Plotly 在 RShiny 中创建水平漏斗图

问题描述

我想在 R Shiny 中创建一个水平漏斗图。我已经尝试过定向功能,但无法使其正常工作。任何帮助将不胜感激

library(plotly)

fig <- plot_ly() 
fig <- fig %>%
  add_trace(
    type = "funnel",
    y = c("Website visit", "Downloads", "Potential customers", "Requested price", "invoice sent"),
    x = c(39, 27.4, 20.6, 11, 2)
    ) 
fig <- fig %>%layout(yaxis = list(categoryarray = c("Website visit", "Downloads", "Potential customers", "Requested price", "invoice sent")))

fig

标签: rshinyplotly

解决方案


推荐阅读