Update app.py
Browse files
app.py
CHANGED
@@ -59,11 +59,12 @@ def executive_summary():
|
|
59 |
fig = make_subplots(
|
60 |
rows=2, cols=2,
|
61 |
specs=[[{"type": "indicator"}, {"type": "indicator"}],
|
62 |
-
[{"type": "
|
63 |
subplot_titles=("Total Guest Views (M)", "Avg Views per Guest (M)",
|
64 |
-
"Guest
|
65 |
)
|
66 |
|
|
|
67 |
fig.add_trace(
|
68 |
go.Indicator(
|
69 |
mode="number",
|
@@ -84,16 +85,21 @@ def executive_summary():
|
|
84 |
row=1, col=2
|
85 |
)
|
86 |
|
|
|
|
|
87 |
fig.add_trace(
|
88 |
-
go.
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
|
|
|
|
93 |
),
|
94 |
row=2, col=1
|
95 |
)
|
96 |
|
|
|
97 |
fig.add_trace(
|
98 |
go.Bar(
|
99 |
x=category_views.index,
|
|
|
59 |
fig = make_subplots(
|
60 |
rows=2, cols=2,
|
61 |
specs=[[{"type": "indicator"}, {"type": "indicator"}],
|
62 |
+
[{"type": "xy"}, {"type": "bar"}]],
|
63 |
subplot_titles=("Total Guest Views (M)", "Avg Views per Guest (M)",
|
64 |
+
"Guest Count by Category", "Views by Category")
|
65 |
)
|
66 |
|
67 |
+
# Add indicator traces
|
68 |
fig.add_trace(
|
69 |
go.Indicator(
|
70 |
mode="number",
|
|
|
85 |
row=1, col=2
|
86 |
)
|
87 |
|
88 |
+
# Add bar chart for guest counts per category
|
89 |
+
guest_counts = guest_by_channel['category'].value_counts().loc[category_views.index]
|
90 |
fig.add_trace(
|
91 |
+
go.Bar(
|
92 |
+
x=guest_counts.index,
|
93 |
+
y=guest_counts.values,
|
94 |
+
marker_color='teal',
|
95 |
+
text=guest_counts.values,
|
96 |
+
textposition='auto',
|
97 |
+
name='Guest Count by Category'
|
98 |
),
|
99 |
row=2, col=1
|
100 |
)
|
101 |
|
102 |
+
# Add bar chart for total views per category
|
103 |
fig.add_trace(
|
104 |
go.Bar(
|
105 |
x=category_views.index,
|