← Back to Editor All Tutorials
中文

How to Draw Pie Charts in Mermaid

Pie charts visualize proportions of a whole. They are ideal for showing traffic sources, time allocation, or budget distribution.

Why Use Pie Charts?

Data Suitability

Best Practices

When NOT to Use Pie Charts?

Basic Syntax

pie title My Pie Chart
    "Category A" : 25
    "Category B" : 35
    "Category C" : 40

Try in MermZen →

Key features:

Examples

Traffic Sources

pie title Monthly Traffic Sources
    "Organic Search" : 42
    "Direct" : 28
    "Social" : 18
    "Referral" : 12

Try in MermZen →

Development Time Allocation

pie title Development Time Distribution
    "Requirements" : 15
    "Frontend" : 35
    "Backend" : 25
    "Testing" : 15
    "Documentation" : 10

Try in MermZen →


To try the above code in MermZen, click Open Editor and paste the code there.