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
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
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 like this
Build a 100-Person Icon Array Demographic Infographic in One HTML File
You get a single HTML file that shows a fictional town as 100 SVG person icons, with tabs for commute, age and housing and an interactive legend that highlights each group.
Build a Classroom Grade Distribution Infographic with Histogram and Quartiles
A single HTML file that turns an inline array of class scores into a histogram with mean and median markers, a box plot, stat cards and a plain-language summary.
Build a Year-over-Year Growth Infographic with Animated Counters and Sparklines
A single HTML file KPI infographic where year-over-year numbers count up once on view, each metric carries an inline SVG sparkline, and reduced-motion users see static final values.
Build an Accessible Market Share Donut Chart Infographic With Legend in HTML
A prompt that builds a single-file SVG donut chart of competitor market share, with a ranked legend, keyboard navigation, tap focus and an automatic Other bucket.
Build an Interactive Team Org Chart One-Pager with Contact Cards in HTML
Get a single HTML file with an expandable SVG org chart, department color coding, clickable contact cards and a search box that highlights matching people.
Build a 12-Week Fitness Progress Tracker Infographic in a Single HTML File
Generates a one-page fitness report with bodyweight and lift line charts, personal-record badges, a streak calendar and an instant kg/lb toggle, all from built-in sample data.