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

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

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

Example: Harbor Coffee Co. Customer Pulse, a live NPS infographic.

The page opens with a score of +47 (Great), and the gauge needle sweeps into place. Drag the promoter, passive or detractor sliders, or use arrow keys on them, to watch the gauge, the stacked bar and the Q3 point on the trend line update together. Try the Rough month scenario to see the score turn negative. Then read the navy insight card, which rewrites its explanation sentence and suggests how many passives to win over.

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

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 in Infographics