Mermaid Gantt Chart Examples
Copy a Mermaid Gantt chart and change the dates. These examples cover task ids, after dependencies, done and critical states, milestones, and excludes weekends.
Start with `gantt`, add a title, and set the date format. Then define sections and tasks with their durations.
gantt
title My Project
dateFormat YYYY-MM-DD
section Phase 1
Task 1 :a1, 2024-01-01, 7d
Task 2 :a2, after a1, 5dLive Editor
Frequently asked questions
How do I make a Mermaid Gantt chart?
Start with gantt, add a title and dateFormat YYYY-MM-DD, then a section and tasks. A task looks like Design :a1, 2024-01-01, 7d. Paste the examples on this page into the editor to change the dates.
What is the Mermaid Gantt syntax for dependencies?
Give the first task an id and start the next one with after that id: Implement :impl, after des, 10d. The second bar begins when the first ends. You do not type the computed date.
How do I add a milestone to a Mermaid Gantt chart?
Add the milestone keyword and a duration of 0d, for example Release :milestone, m2, after test, 0d. Milestones render as a point in time rather than a bar.
How do I exclude weekends in a Mermaid Gantt chart?
Put excludes weekends under the date format. Durations such as 5d then count working days, and the bar skips Saturday and Sunday on the calendar.
More Tutorials
All tutorialsFlowchart Syntax Guide — Nodes, Arrows & Subgraphs
Master Mermaid flowchart syntax with this interactive guide. Learn node shapes, connections, and advanced features.
Mermaid Sequence Diagram with Examples
Copy a Mermaid sequenceDiagram and edit it in the browser. The examples below cover participants, solid and dashed messages, activation, loops, and alt fragments.
ER Diagram Tutorial — Entities, Keys & Relationships
Design database schemas visually with Mermaid ER diagrams. Learn entity declarations, attribute types, relationships, and cardinality notation.
Getting Started — Your First Mermaid Diagram in 2 Minutes
New to Mermaid? Start here. Learn the fundamentals and create your first diagram in minutes.