Skip to main content

Claude Prompt to Design a Data Visualization Dashboard

Specify audience, metrics, and charting library and get justified chart types, layout hierarchy, KPI cards, and a working component.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
Design a SaaS analytics dashboard for product managers and executives.

Key metrics to display: MRR, churn rate, active users, feature adoption, NPS, support tickets
Data sources: PostgreSQL, Stripe API, Mixpanel
Refresh frequency: real-time for active users, hourly for revenue, daily for trends
Charting library: Recharts (React)

Design the dashboard:
1. **Information Hierarchy** — what users see first, second, third
2. **Layout Grid** — 12-column responsive grid with section descriptions
3. **For each visualization:**
   - Chart type (and why it is the best choice for this data)
   - Data fields mapped to axes/dimensions
   - Interactivity (hover tooltips, click-to-drill, filters)
   - Color encoding strategy
   - Responsive behavior (mobile collapse)
4. **KPI Cards** — 4 top-level KPIs with sparklines and trend indicators
5. **Filters** — global and chart-level filter design
6. **Empty/Loading States** — skeleton design for each component
7. **Accessibility** — color-blind safe palette, screen reader data tables
8. **Code** — Recharts (React) implementation for the MRR trend with cohort breakdown chart component

Follow data visualization best practices: no 3D charts, no pie charts for >5 categories, proper axis labeling, honest scales.

What this prompt does

This prompt gives an AI assistant enough structured context to make real design decisions — not just list chart types, but argue why each one fits the specific data relationship you are showing. The template forces a top-to-bottom information hierarchy pass before touching any grid layout, which mirrors how skilled data product designers actually work: decide what the user needs to conclude first, then position it.

The eight-section breakdown (hierarchy → grid → per-chart spec → KPIs → filters → empty states → accessibility → code) mirrors a production dashboard spec. The explicit constraints — no 3D charts, no pie charts beyond five categories, honest scales — are wired directly into the template so the output enforces visualization hygiene without you needing to police it.

The code output is scoped to one [priority_chart] component rather than the whole dashboard, which keeps the generated code actually useful. Full dashboard codegen degrades into untestable boilerplate; one well-constructed chart component you can drop in and verify is far more valuable.

When to use it

  • Building an ops dashboard for an engineering team tracking deployment frequency, error rates, and p99 latency from a mix of Datadog and a Postgres replica.
  • Designing a revenue analytics view for a SaaS product where the audience is non-technical executives who need MRR, churn, and expansion at a glance.
  • Planning a public-facing metrics page (uptime, usage stats) and needing responsive behavior specced out before writing any CSS.
  • Evaluating which charting library (Recharts vs. Chart.js vs. Apache ECharts) fits your component structure — run the same variables through the prompt with a different [chart_library] to compare the generated implementations.
  • Doing a dashboard audit: fill [metrics] with what you currently show and [audience] with your actual users to get a hierarchy critique against what you built.

Example output

dashboard_type: SaaS revenue analytics
audience: Customer Success Managers
metrics: MRR, churn rate, expansion revenue, account health score
data_sources: Stripe webhook replica (Postgres), Salesforce API
refresh_rate: daily at 06:00 UTC
chart_library: Recharts
columns: 12
kpi_count: 4
priority_chart: MRR trend with churn overlay

Information Hierarchy:
  1st — 4 KPI cards across top row: MRR (with sparkline), Churn Rate,
         Expansion MRR, Accounts at Risk
  2nd — MRR trend + churn overlay (ComposedChart, full width, center)
  3rd — Account health score distribution (BarChart, right column)

Priority chart: MRR trend with churn overlay (Recharts ComposedChart)

import {
  ComposedChart, Bar, Line, XAxis, YAxis, CartesianGrid,
  Tooltip, Legend, ResponsiveContainer
} from 'recharts';

// Left Y-axis: MRR in USD (Bar, fill #3B82F6)
// Right Y-axis: Churn % (Line, stroke #EF4444, strokeDasharray="4 2")
// X-axis: ISO month labels (Jan 2025 … Dec 2025)
// Tooltip: custom formatter — MRR as $123,456, churn as 2.4%
// onClick: drills to account list filtered by selected month
// Mobile: ResponsiveContainer collapses legend below chart at <640px

Pro tips

  • Set [refresh_rate] honestly. If your data is daily, specifying "real-time" makes the AI suggest WebSocket patterns and streaming state managers you do not need — and will not build.
  • Name a real audience in [audience], not "users." "Finance analysts who export to Excel" changes which interactivity the AI recommends versus "C-suite executives who glance at a TV display" — the former gets sortable tables and CSV export, the latter gets large-type KPI cards and no interactive filters.
  • Run the accessibility section output past your design system's contrast checker. The prompt requests a color-blind-safe palette, but the specific hex values generated depend on your [chart_library]'s default color scale — verify the AA contrast ratio before shipping.
  • When comparing charting libraries, change only [chart_library] between runs and hold all other variables constant. This gives you an apples-to-apples implementation comparison for the same chart, not a mix of different chart types across different libraries.
  • Pair this prompt with a follow-up asking for filter state management logic separately. Filter UX is where dashboard complexity explodes — React Context vs. URL params vs. Zustand is a non-trivial decision that deserves its own prompt context rather than being a footnote in section 5.

Frequently Asked Questions

Can I use this prompt if I have not chosen a charting library yet?
Yes — set [chart_library] to 'undecided' and describe your stack (React, Vue, plain JS). The output will recommend two or three libraries with tradeoffs for your specific chart mix, then show a code sketch in the one it recommends. You can rerun with a pinned library once you decide.
The prompt says no pie charts for more than five categories — what if I need to show eight segments?
The prompt will push back and suggest a horizontal bar chart or a treemap instead, which is the correct call for eight categories. If you genuinely need the pie breakdown — for example, a client has signed off on it — override by adding 'the client requires a pie chart for this section' to [metrics]. The AI will comply but will note the readability tradeoff in its chart justification.
Will the generated code work directly in my project, or is it a starting point?
It is a production-quality starting point for the single [priority_chart] component — not a copy-paste drop-in for the whole dashboard. Expect to wire up your real data fetching, adjust prop types to your schema, and handle edge cases the prompt cannot know about (auth-gated data, your specific state manager, error boundaries). The skeleton design section gives you the loading state pattern to implement alongside the component.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in Data & SQL Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support