When to use a scatter chart
Scatter charts reveal correlation, clusters, and outliers between two measures.
- Ad spend vs. conversions by channel
- Price vs. rating by product
- Latency vs. payload size by endpoint
Data format
- Use exactly 3 columns: Category,X,Y. The category sets each point's color and legend group.
- Paste CSV, JSON from your API, TSV copied from Excel or Google Sheets, or a Markdown table. The generated component keeps your column names as its data keys.
Segment,Spend,Conversions
Search,4200,320
Social,3100,210
Email,1800,260
Display,2600,140
Affiliate,1200,95[
{"segment": "Search", "spend": 4200, "conversions": 320},
{"segment": "Social", "spend": 3100, "conversions": 210},
{"segment": "Email", "spend": 1800, "conversions": 260},
…
]Options
- Colors
- Custom color per category group.
How to add it to your project
- 1. Add the shadcn/ui chart component (it installs Recharts):
npx shadcn@latest add chart - 2. Paste your data above, pick the options, and copy the generated
chart.tsx. - 3. Save it in your project (e.g.
components/scatter-chart.tsx) and render<Chart />, or<Chart data={rows} />in Data as prop mode.
Scatter Chart FAQ
Three columns: a category that groups points, then the X value, then the Y value. The generated component groups rows by category at render time.
Yes. Your X and Y column names become the axis titles, and ticks use compact numbers like 1.5K.
Not yet. A size column for bubble charts is on the roadmap.