forked from avinashkranjan/Amazing-Python-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFunnelCharts.py
33 lines (28 loc) · 932 Bytes
/
FunnelCharts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from plotly import graph_objects as go
fig = go.Figure()
fig.add_trace(go.Funnel(
name = 'India',
y = ["McDonalds", "Dominoz", "PizzaHut", "Subway" , "MadOverDonuts" , "Keventers"],
x = [150, 140, 40, 50, 40 , 20],
textposition = "inside",
textinfo = "value+percent initial"))
fig.add_trace(go.Funnel(
name = 'Bangladesh',
orientation = "h",
y = ["McDonalds", "Dominoz", "PizzaHut", "Subway"],
x = [50, 60, 40, 30],
textposition = "inside",
textinfo = "value+percent previous"))
fig.add_trace(go.Funnel(
name = 'SriLanka',
orientation = "h",
y = ["McDonalds", "Dominoz", "PizzaHut", "Subway" ,"MadOverDonuts" ],
x = [90, 70, 50, 30, 10],
textposition = "outside",
textinfo = "value+percent total"))
fig.update_layout(
title = "Funnel Chart for Food Sales in Asian Countries",
showlegend = True
)
fig.layout.template = 'plotly_dark'
fig.show()