Support ticket mix
showData prints the counts you typed. Mermaid converts them to shares of the total.
pie showData
title Support tickets this week
"Editor" : 42
"Export" : 18
"Billing" : 16
"Sign-in" : 11
"Other" : 7A pie chart shows how a total splits across a handful of categories. Each line is one slice.
Copy an example, or open it in the live editor with this diagram already loaded.
showData prints the counts you typed. Mermaid converts them to shares of the total.
pie showData
title Support tickets this week
"Editor" : 42
"Export" : 18
"Billing" : 16
"Sign-in" : 11
"Other" : 7The values are dollars, not percentages. A slice's angle is its share of the sum.
pie showData
title Q2 budget
"Engineering" : 480
"Support" : 160
"Marketing" : 140
"Operations" : 90Small answers are grouped so the chart stays readable. Five slices is usually the limit.
pie showData
title How did you find the editor
"Search" : 46
"Docs" : 22
"A teammate" : 18
"Social" : 8
"Other" : 6A Mermaid pie chart draws one slice per labeled value. Mermaid totals the numbers and sizes each slice as its share of that total, so the values do not need to add up to 100. showData prints the raw number next to the label. Keep the chart to a few slices. A pie chart answers 'what share is this?' and it is a poor fit for a trend, a ranking of many items, or two series.
Use a pie chart for a mix that sums to one whole: traffic sources, budget shares, or ticket categories. Use an XY chart when you are comparing values over time or across many categories. Use a Sankey diagram when the story is how a quantity splits and then splits again.
Edit this pie chart in the live editor, read the Mermaid cheat sheet, or compare it with Flowchart, Gantt Chart and Mind Map.
| Element | Syntax | Description |
|---|---|---|
| Title | title Chart Title | Chart heading |
| Data item | "Label" : value | Add a slice |
| Show data | showData | Print the raw value beside each slice |
| Multiple items | One per line | Each line is a slice |
Entering percentages that already sum to 100 and also expecting Mermaid to treat them as extra metadata.
Mermaid only sees the numbers. If the numbers are already percentages, they still work, because only the ratios matter.
Adding a seventh slice for every small category.
Fold the tail into Other. A pie chart with many slivers stops being readable.
Using a pie chart for a trend.
A pie has no x-axis. Plot the series on an XY chart instead.
Pie charts are compact, so PNG is usually enough for a slide. Use SVG when the chart sits in a docs page. Free PNG exports include a watermark.
High-resolution images for documents and presentations.
Scalable vectors for web and further editing.
Print-ready format for professional documentation.
Got Mermaid code from ChatGPT? Paste it here to render and export instantly.
All 21 diagram types in one PDF reference.
Open the editor with this example pre-loaded and start customizing.