All diagram types Open editor

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.7

Syntax quick reference

How to use it

  1. Open the example in the editor, or paste your own Mermaid code.
  2. Edit the code on the left. The preview updates as you type, and errors point to the line.
  3. Export SVG or PNG, copy a Markdown block for GitHub or Notion, or copy a share link.

More diagram types