Build a Before-and-After Statistics Infographic With Color-Coded Change Arrows
A single HTML infographic comparing two years across nine metrics, showing old and new values, absolute and percent change, and arrows colored by whether up is good.
The prompt
Act as a senior information designer and front-end developer. Build a single-page infographic called 'Harbor City Bike Share: Two Years of Change' that compares 2022 with 2024 across nine metrics: annual rides, active members, cost per ride, empty-dock hours per week, collisions per 100k rides, repair turnaround, CO2 avoided, monthly complaints and app rating. Each metric card shows the old value, the new value, the absolute change and the percent change. Rules: 1) Keep all metrics in one data array where each item says whether up is good or down is good. Compute the status from that, so rising cost shows red and falling collisions show green. Arrows point in the real direction, and unchanged metrics show a gray dash. 2) Never rely on color alone. Add an Improved, Worsened or Unchanged badge and a full screen-reader label to every card. 3) Add a summary strip with the improved, worsened and unchanged counts plus the biggest improvement. Add pill buttons that filter by status and sort by biggest change, using aria-pressed. 4) Give each card paired before and after bars that grow on load, and skip that animation under prefers-reduced-motion. 5) Use a responsive card grid from 360 to 1280px, a warm off-white background, navy text, green, red and gray status colors, system fonts and no external assets. 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 per-metric 'up is good' flag lets the code decide colors, so arrows stay honest while red and green reflect real impact.
- Badges plus screen-reader labels repeat the status in words, so the chart works without color.
- One data array drives the cards, summary and filters, so editing numbers updates everything at once.
Paste into ChatGPT, Claude or Gemini. Save the returned code as an .html file and open it in any browser, or view it in the chat's preview or canvas. Swap in your own numbers by editing the data array.
Common edits
- Replace the data array with your own metrics, years and units, setting good to 'up' or 'down' for each one.
- Change the status colors or add a third time period by adding a column to each card.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
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 an Interactive NPS Infographic with Gauge, Breakdown and Trend in HTML
A single HTML file that calculates Net Promoter Score from response counts, shows it on a semicircle gauge with a breakdown bar and trend chart, and explains the score in one generated sentence.
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 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.
Build a Budget Allocation Treemap Infographic in a Single HTML File
You get one HTML file that draws a squarified treemap of a city budget, hides labels on small blocks, and shows a details panel when you tap or click any block.
Build a Company Fact Sheet One-Pager with Animated Stats and a Location Map
You get a single HTML file laid out like an investor or press fact sheet, with animated stat counters, mission, leadership, milestones, an interactive SVG office map and a brand-color theme switch.