Build a Gantt-Style Project Timeline Infographic with Milestones in Pure SVG

A single HTML file that draws a project Gantt chart in pure SVG, with progress bars, dependency arrows, milestone diamonds, a Today marker and hover tooltips.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
Act as a senior front-end developer and information designer. Build "Northgate Library Renovation 2025", a horizontal Gantt-style project timeline infographic drawn in inline SVG with vanilla JavaScript and no charting library. Show 10 phases running from January to early November across four color-coded workstreams: Planning, Procurement, Construction and Fit-out. Add a milestones row with four diamond markers and curved finish-to-start dependency arrows between phases.

Rules:
1. Each bar shows its full duration as a light tint with a solid progress fill and a Done or percent label. Draw a red Today line at a fixed status date of 18 June 2025 with a pill label, and lightly shade the elapsed time.
2. Hovering, tapping or tabbing to a bar or milestone shows a dark tooltip with dates, duration, owner, status, dependencies and a one-line note. It also dims everything except that phase, its predecessors, its successors and their arrows. Escape or tapping elsewhere clears it.
3. Above the chart, show an eyebrow, a title and a one-sentence intro. Add four stat cards (progress weighted by duration, phases complete, countdown to the next milestone, reopening date) and a legend.
4. Rebuild the SVG on resize. Below 600px, narrow the label column and let the chart scroll horizontally inside its card.
5. Use a warm off-white background, a white card, a system font and readable contrast. Bars grow in on load unless prefers-reduced-motion is set.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Northgate Library Renovation 2025, a pure-SVG Gantt timeline.

Ten phases run across four colored workstreams. Each bar shows how far that phase has progressed, and curved arrows show what each phase waits on. A red Today line marks 18 June. Hover, tap or press Tab to open a tooltip with dates, owner and status. The phase's predecessors and successors stay highlighted while everything else dims. Press Esc to clear. Try narrowing the window to see the chart scroll sideways.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • A fixed status date keeps the Today marker and countdown meaningful whenever the file is opened.
  • Finish-to-start data drives the arrows and highlighting, so dependencies stay correct when phases change.
  • Rebuilding the SVG on resize, with a minimum width and horizontal scroll, keeps labels readable from 360px up.

Paste into ChatGPT, Claude or Gemini. Save the code as an .html file and open it in any browser, or run it in the chat's canvas or preview pane. Swap in your own phases by editing the data array at the top of the script.

Common edits

  • Replace the phases array with your own project's names, dates, owners and progress, and change the four workstream colors.
  • Set the Today marker to the real current date, or add a click-to-sort toggle that reorders rows by start date or workstream.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Infographics