Waterfall P&L bridge
Apple FY2024 income statement (10-K, ended 2024-09-28)
Example from the compendium of canonical charts
Python Code
"""Waterfall P&L bridge — Apple FY2024 income statement (10-K, ended 2024-09-28)."""
import plotly.graph_objects as go
# Source: Apple FY2024 10-K, all figures in $M
ROWS = [
# (label, value, measure)
("Revenue", 391_035, "absolute"),
("COGS", -210_352, "relative"),
("Gross Profit", 0, "total"),
("OpEx", -57_467, "relative"),
("Operating Income", 0, "total"),
("Tax", -29_749, "relative"),
("Net Income", 0, "total"),
]
LABELS, VALUES, MEASURES = zip(*ROWS)
TEXT_LABELS = [
"$391.0B", "−$210.4B", "$180.7B",
"−$57.5B", "$123.2B", "−$29.7B", "$93.7B",
]
def generate():
print("building Apple FY2024 waterfall (hardcoded 10-K data) …")
fig = go.Figure(go.Waterfall(
orientation="v",
measure=list(MEASURES),
x=list(LABELS),
y=list(VALUES),
text=TEXT_LABELS,
textposition="outside",
connector=dict(line=dict(color="#d9d9e0")),
increasing=dict(marker=dict(color=GREEN)),
decreasing=dict(marker=dict(color=PINK)),
totals=dict(marker=dict(color=VIOLET)),
))
fig.update_layout(
title=dict(text="Apple FY2024 P&L Bridge ($M, ended Sep 28 2024)", x=0.5),
yaxis=dict(title="$M", tickformat="$,.0f", showgrid=False),
xaxis=dict(showgrid=False),
margin=dict(t=60, b=40, l=80, r=40),
height=460,
showlegend=False,
)
return fig
if __name__ == "__main__":
generate()
Made with Plotly