Markdown pie chart maker
Make a quick pie chart from a few numbers. Label the slices in a Mermaid block to show a simple breakdown inline in your document.
Mermaid pie chart syntax
A pie chart is a title and a list of labelled slices. You give each slice a name and a number, and Mermaid works out the angles. Here is each piece you can write.
Basic pie
Start with the word pie, then list each slice as a quoted label, a colon and a number.
You write
pie
"Dogs" : 40
"Cats" : 35
"Birds" : 25
You get
Title
Add title after pie to name the chart.
You write
pie title Household pets
"Dogs" : 40
"Cats" : 35
"Birds" : 25
You get
Show the values
Add showData to print each number next to its label.
You write
pie showData
"North" : 120
"South" : 80
"East" : 65
"West" : 45
You get
Cheat sheet
| Write this | You get |
|---|---|
pie | Start a pie chart |
pie title Text | Start a pie chart with a title |
pie showData | Show each slice value alongside its label |
"Label" : 40 | A slice with its value |