merIDK / Diagram types / Pie chart
Mermaid pie chart: example and syntax
Pie charts show how a whole splits into parts. In Mermaid they take one line per slice, which makes them the quickest chart to add to a README or a doc.
Open this example in the editor
Example code
pie showData
title Browser share
"Chrome" : 64.7
"Safari" : 18.6
"Edge" : 5.2
"Firefox" : 2.8
"Other" : 8.7
Result
pie showData
title Browser share
"Chrome" : 64.7
"Safari" : 18.6
"Edge" : 5.2
"Firefox" : 2.8
"Other" : 8.7Syntax quick reference
- Each slice:
"Label" : value. pie showDataprints the values in the legend.- Add a heading with
title.
How to use it
- Open the example in the editor, or paste your own Mermaid code.
- Edit the code on the left. The preview updates as you type, and errors point to the line.
- Export SVG or PNG, copy a Markdown block for GitHub or Notion, or copy a share link.