Example
gantt
title MermanDraw Roadmap
dateFormat YYYY-MM-DD
section Core
Editor & Preview :done, e1, 2024-01-01, 14d
PNG / SVG Export :done, e2, after e1, 7d
Anonymous Sharing :done, e3, after e2, 7d
section Launch
Landing Page :done, l1, after e3, 5d
Cloudflare Deploy :done, l2, after l1, 3d
section Growth
Cheatsheet :done, g1, after l2, 7d
Type Guides :active, g2, after g1, 14d
Auto-fix : g3, after g2, 21d Syntax
Setup and tasks
gantt
title Q3 release plan
dateFormat YYYY-MM-DD
axisFormat %b %d
section Build
Design review :done, d1, 2026-07-01, 5d
Implementation :active, d2, after d1, 15d
QA : d3, after d2, 7d
section Launch
Beta :crit, l1, after d3, 5d
Public release :milestone, l2, after l1, 0d Task line: Name : [tags,] id, start, duration|end. Tags: done, active, crit, milestone. dateFormat parses the dates you write; axisFormat controls the axis labels (d3 time format).
Dependencies and excludes
gantt
dateFormat YYYY-MM-DD
excludes weekends
section Work
Spec :a, 2026-08-03, 3d
Build :b, after a, 5d
Test :c, after a b, 2d after a b starts when both finish. excludes weekends (or specific dates) skips non-working days when computing durations.
Axis control
gantt
dateFormat YYYY-MM-DD
tickInterval 1week
weekday monday
section Plan
Task :2026-09-01, 21d Common mistakes
These are the parse errors that come up most, including in code written by ChatGPT and Claude. Paste any failing diagram into the editor and it marks the offending line.
-
Dates that do not match
dateFormat(dateFormat YYYY-MM-DDwith03/09/2026).Fix: Match the format exactly or change
dateFormat. Unparseable dates silently become today. -
Colons in task names (
Phase 1: Design : d1, 2026-01-01, 5d).Fix: The first colon ends the name. Use a dash or parentheses in task text.
-
Dependency on an ID that is defined later or misspelled.
Fix:
after xneedsxalready declared above. Keep IDs short and consistent (d1,d2). -
Forgetting the ID and writing
afteron the next task.Fix: A task without an explicit ID gets an auto-generated one you cannot reference. Give every task you depend on an ID.
Real-world examples
Complete, copy-ready gantts for common situations. Each one opens in the editor with a click.
-
Software Project Gantt Chart with Dependencies and Milestone
A Mermaid Gantt chart for a website redesign in three sections, discovery, design, and build, with task ids, after-dependencies, status tags, and a milestone.
-
Two-Week Sprint Plan Gantt Chart (Excludes Weekends)
A Mermaid Gantt chart for a two-week sprint with backend, frontend, and QA sections, day-level durations, weekends excluded, and a release-candidate milestone.
FAQ
Can I show today's date?
Mermaid draws a vertical "today" marker automatically when today falls inside the chart range. Disable it with todayMarker off.
How do I draw a milestone?
Tag the task milestone and give it a zero duration: Release :milestone, m1, 2026-09-30, 0d. It renders as a diamond.
Does GitHub render Gantt charts?
Yes, inside a mermaid fenced block. For slide decks or chat, export a PNG from MermanDraw instead.