Build a Likert-Scale Survey Results Infographic With Diverging Stacked Bars

A ready-to-paste prompt that builds a one-file survey infographic with diverging Likert bars centered on neutral, sample-size and margin-of-error callouts, net scores and key takeaways.

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

The prompt

Prompt
Act as a senior data-visualization designer who writes clean vanilla HTML, CSS and JavaScript. Build a survey results infographic titled Riverside Library Patron Survey 2025. It shows how 1,248 library users rated six statements on a 5-point Likert scale, from strongly disagree to strongly agree. Invent realistic percentages that total 100 for each statement, with one clear win, one weak spot and a few near-even splits. The core visual is a diverging stacked bar chart. Each bar is centered on the middle of its neutral segment, so disagreement extends left and agreement extends right of a shared vertical axis.
Rules:
1. Above the chart, show callout tiles for sample size, margin of error (±2.8 points at 95% confidence), fieldwork dates and number of statements.
2. Use a five-color diverging palette: warm reds for disagree, warm grey for neutral and blues for agree. Keep segment labels readable on every color.
3. Add a net score column (agree minus disagree). Flag any net within twice the margin of error as Too close.
4. Add sort buttons for survey order, most positive and most negative. Add a clickable legend that highlights one answer. Show tooltips with the percent and approximate headcount on hover, tap or keyboard focus.
5. End with three key takeaway cards and a short method note.
6. The layout must work from 360 to 1280px wide and use no external assets. Bars grow from the axis 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: Riverside Library Patron Survey 2025, a diverging Likert infographic.

Six statements appear as bars centered on the neutral answer, so the overall lean of each one shows at a glance. Tiles at the top give n = 1,248 and the ±2.8-point margin of error.

  • Use the Most positive or Most negative buttons to re-sort the bars and replay the animation.
  • Click a legend item, such as Strongly agree, to highlight that answer across all bars.
  • Hover over, tap or Tab to any segment to see its exact percent and headcount.
Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Centering each bar on the midpoint of neutral is spelled out, so the model computes a shared axis instead of plain left-aligned stacks.
  • Requiring a net score plus a Too close flag at twice the margin of error makes the statistical caveat visible, not buried.
  • Fixed sample size, margin of error and theme mean the page works on first paste, with no follow-up questions.

Paste the prompt 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. To chart real results, swap in your own statements and percentages.

Common edits

  • Replace the library statements and percentages with your own survey data. Keep each row summing to 100 and update n and the margin of error.
  • Switch to a 7-point scale or a colorblind-safe purple and orange palette by editing the category list and color rule.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Infographics