All tutorials

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, 5d

Live Editor

Unsaved
Ready
Loading Monaco Editor...
Preview
Styling
Gantt Chart

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 tutorials