原始数据的形式是这样的:

from plotly import graph_objects as go
trace = go.Funnel(
y = dt_3_s["指标"], #纵轴表示各种阶段的指标
x = dt_3_s["汇总"], #横轴表示这些指标的具体数值,大小由宽度显示
textinfo = "value+percent initial",
marker=dict(color=["deepskyblue", "lightsalmon", "tan", "teal", "silver", "yellow"]),
connector = {"line": {"color": "royalblue", "dash": "solid", "width": 3}}
)
data =[trace]
fig = go.Figure(data)
fig.show()


多个对象的漏斗图参见:
绘制不同网站的对比转化率漏斗图
网友评论