Combo Chart
Blend bar and line series to compare magnitude and trend on dual or shared axes.
Source
LLM docs
Package
npm install @plocks/chartsExamples
3
Properties
56
Playground
Basics
Combines multiple chart types (e.g., bars and line) for richer comparison.
Loading demo…
import { ComboChart } from '@plocks/charts';
import { LAYERS } from './data';
export function Demo() {
return (
<ComboChart
title="Revenue vs. active users"
subtitle="First half of FY25"
h={340}
layers={LAYERS}
enableCrosshair
multiTooltip
liveTooltip
xAxis={{
show: true,
title: 'Month',
labelFormatter: (value) => `M${value}`,
}}
yAxis={{
show: true,
title: 'Revenue (USD thousands)',
labelFormatter: (value) => `$${value}`,
}}
yAxisRight={{
show: true,
title: 'Active users (thousands)',
labelFormatter: (value) => `${value}k`,
}}
yDomain={[0, 650]}
yDomainRight={[80, 200]}
grid={{ show: true, style: 'dashed' }}
legend={{ show: true, position: 'bottom' }}
/>
);
}Reference marks
Reference areas below the layers, lines and dots above them;
y reads against the primary (left) axis.Loading demo…
import { ComboChart } from '@plocks/charts';
import { LAYERS } from './data';
export function Demo() {
return (
<ComboChart
title="Monthly orders"
h={320}
layers={LAYERS}
yDomain={[0, 700]}
referenceAreas={[{ x1: 4.5, x2: 6.5, color: '#10b981', label: 'Promo' }]}
referenceLines={[{ y: 500, label: 'Target 500', color: '#f59e0b', dashed: true }]}
referenceDots={[{ x: 12, y: 640, r: 6, color: '#10b981', label: 'Record' }]}
xAxis={{ show: true, labelFormatter: (value) => `M${value}` }}
yAxis={{ show: true }}
legend={{ show: true, position: 'bottom' }}
/>
);
}Brush
The brush preview draws each layer the way the chart does; bars and lines follow the window together.
Loading demo…
import { ComboChart } from '@plocks/charts';
import { LAYERS } from './data';
export function Demo() {
return (
<ComboChart
h={340}
layers={LAYERS}
withBrush
brushProps={{ start: 37, end: 60 }}
xAxis={{ show: true, labelFormatter: (value) => `M${value}` }}
yAxis={{ show: true }}
/>
);
}Related charts
Further reading
React Native design for iOS, Android, and Web.
Quick Links
Resources