Mermaid Gantt charts: project timelines, milestones, and dependencies
Mermaid’s Gantt chart is a project management powerhouse — describe task timelines, milestones, and dependencies in text, embed directly in docs. PlantUML’s Gantt support is weak; Mermaid is the clear winner here.
What is a Gantt Chart
A Gantt chart plots tasks on the vertical axis against time on the horizontal axis, showing:
- When each task starts and ends
- Dependencies between tasks
- Key milestones
- Which tasks run in parallel
Use cases: Sprint planning, release roadmaps, technical migration timelines, version schedules.
Minimal Example
1 | gantt |
titlesets the chart titledateFormatdeclares the date formatsectiongroups tasks by responsibilitytask name: ID, start date, duration(7d = 7 days;after ID= starts after another task ends)
Date Formats
1 | gantt |
Common formats:
YYYY-MM-DD— ISO standard, recommendedYYYY/MM/DD— US styleYYYY-MMM-DD— month abbreviation (2026-Jan-15)YYYY-MM-DD HH:mm— hour-level precision
Task Duration
1 | gantt |
Duration units: d (days), w (weeks), m (months), h (hours).
Section Grouping
1 | gantt |
Sections keep related tasks together and make the chart much more readable.
Milestones
Milestones mark critical checkpoints — milestone keyword with 0d duration:
1 | gantt |
0d duration is the key — Mermaid renders it as a diamond shape.
Dependencies
after — starts when predecessor ends
1 | gantt |
Chain syntax
1 | gantt |
Parallel tasks
1 | gantt |
Task D waits for both B and C to complete.
Task Colors
1 | gantt |
Mermaid built-in status keywords: done (green), crit (red), active (blue), future (gray).
Custom colors
1 | gantt |
Today Marker
1 | %%{init: {'theme': 'base'}}%% |
todayMarker draws a red vertical line at the current date — essential for sprint planning visibility.
Mermaid vs PlantUML Gantt
| Feature | Mermaid Gantt | PlantUML Gantt |
|---|---|---|
| Task duration | ✅ d/w/m/h | ✅ d/w/m |
| Dependencies | ✅ after ID |
✅ then chain |
| Milestones | ✅ milestone |
✅ milestone |
| Section grouping | ✅ | ❌ |
| Status colors | ✅ done/crit/active | ✅ style |
| todayMarker | ✅ | ❌ |
| Resource allocation | ❌ | ✅ resource |
| Readability | very clean | more verbose |
Use Mermaid for documentation and planning — quick, beautiful. Use PlantUML for resource-heavy scheduling with fine-grained control.
Common Errors
| Error | Cause | Fix |
|---|---|---|
| Tasks not rendering | Wrong date format | Match task date format to dateFormat declaration |
| Circular dependency | after points to later task |
Check dependency chain has no loops |
| Tasks overlap | Parallel tasks missing after |
Parallel tasks still need dependency declarations |
| Chinese not displaying | Font issue | Use fontawesome theme or switch theme |
Recap
5 things to remember:
dateFormat YYYY-MM-DDdeclare the format before using datessectiongroups tasks — much cleaner for complex projectsafter IDorafter tasknameis the dependency declaration; chain syntax is most readablemilestonemarks key dates;0d= diamond markertodayMarker stroke:#ff3draws today’s date line — essential for sprints
PlantUML Gantt is more powerful but more complex — for daily docs, README, sprint boards, Mermaid Gantt is sufficient.
- Title: Mermaid Gantt charts: project timelines, milestones, and dependencies
- Author: puml.online
- Created at : 2026-08-08 10:00:00
- Updated at : 2026-08-14 21:34:29
- Link: https://puml.online/blog/mermaid-gantt-en/
- License: This work is licensed under CC BY-NC-SA 4.0.