When to use a combo chart
Combo charts put two related measures in one view without making them compete.
- Revenue (bars) vs. target (line)
- Orders (bars) with a moving average (line)
- Spend (bars) with conversions (line)
Data format
- By default the first series renders as bars and the rest as lines.
- 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.
Month,Revenue,Target
Jan,42000,45000
Feb,58000,50000
Mar,51000,55000
Apr,67000,60000
May,72000,65000
Jun,69000,70000[
{"month": "Jan", "revenue": 42000, "target": 45000},
{"month": "Feb", "revenue": 58000, "target": 50000},
{"month": "Mar", "revenue": 51000, "target": 55000},
…
]Options
- Series type
- Switch any series between Bar and Line.
- Colors
- Custom color per series.
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/combo-chart.tsx) and render<Chart />, or<Chart data={rows} />in Data as prop mode.
Combo Chart FAQ
Use ComposedChart and place <Bar> and <Line> elements inside it. ChartCN generates the ComposedChart with the mix you choose.
Yes. Every series has its own Bar / Line switch.
Not in the generator yet. Both series share one axis, which works best when they use similar units.