Mermaid code
pie showData
title Monthly cloud spend by category
"Compute" : 42
"Managed databases" : 21
"Object storage" : 11
"Network egress" : 9
"Observability" : 8
"Other services" : 9 Paste this into any tool that renders Mermaid, or into the editor to change the theme and export PNG or SVG. Syntax reference: Pie Chart guide.
What this diagram shows
Six slices add up to 100. Compute at 42 percent and Managed databases at 21 percent are two thirds of the bill, so those are where a reserved-capacity discussion starts. The showData keyword after pie prints each value next to its legend entry, which saves readers from estimating angles. Slice order in the chart follows the order in the source.
Pie charts work when there are six or fewer categories and the message is proportion. For a trend over months, use an XY chart instead.
How to adapt it
- Replace the six values with the percentages or raw amounts from your billing export; Mermaid normalizes them, so they do not have to sum to 100.
- Rename slices to match your provider's service categories, or group by team or environment instead of by service.
- Remove
showDataif the chart appears in a slide where the legend values would be too small to read. - Keep rare services inside
Other servicesrather than adding slices under 3 percent, which render as unreadable slivers.
FAQ
Do the values have to be percentages?
No. Any positive numbers work; Mermaid computes each slice as its share of the total. You can paste dollar amounts directly and the chart stays correct.
Can I control the slice colors?
Yes, through theme variables pie1 through pie12 in an init directive, for example %%{init: {"themeVariables": {"pie1": "#4f46e5"}}}%%. Colors are assigned in source order.