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.
The prompt
Act as a senior front-end developer and information designer. Build a one-page NPS infographic called Harbor Coffee Co. Customer Pulse for a café chain's Q3 2024 guest survey. Start with 412 promoters, 168 passives and 96 detractors. Compute NPS as percent promoters minus percent detractors, and show it on a semicircle SVG gauge that runs from -100 to +100. Rules: 1) Split the gauge into four colored zones: Needs work below 0, Good 0-29, Great 30-69, Excellent 70 and up. Add tick labels and an animated needle, and show the large score with its band label underneath. 2) Add a breakdown card with a stacked 100% bar. Below it, place three keyboard-accessible range sliders for the promoter, passive and detractor counts, plus three scenario buttons: actual, rough month and breakout quarter. Everything recalculates live. 3) Draw an SVG trend line covering five earlier quarters (28, 31, 35, 38, 42), with the current score as the highlighted last point and an axis that rescales automatically. 4) Generate one plain-English sentence that explains the score. Include the band, the change from last quarter, the promoter and detractor shares and the promoter-to-detractor ratio. Follow it with a tip on converting passives. 5) Use a warm off-white background, a navy accent, green, amber and red segments with readable contrast, and system fonts. Use two columns above 860px and one column on phones. 6) Skip the needle animation under prefers-reduced-motion. Use no external files and no storage. 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
- Exact starting counts and past quarters give the model real numbers, so the gauge, bar and trend look finished on first load.
- Named band thresholds and a fixed formula keep the score, colors and generated sentence consistent with each other.
- Range sliders and preset buttons add interactivity without forms, and they work with mouse, touch and keyboard.
Paste into ChatGPT, Claude or Gemini. Save the reply's code as nps.html and open it in any browser, or view it in the chat's preview or canvas. To use your own results, swap in your survey counts and past quarters.
Common edits
- Change the brand, counts and five past quarter values to match your own survey, or rename the bands to your industry benchmarks.
- Add a second series for a competitor or a target line on the trend chart, or switch the navy accent to your brand color.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
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.
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 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 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.