import { curveCatmullRom } from "d3-shape";
const yDomains = {
orders: ([, max]) => [0, max * 3], // bars in the bottom third
left: [minValue - range * 0.6, maxValue + range * 0.05], // band + points above them
};
<ComposedChart data={data} xDataKey="date" aspectRatio="2 / 1" maxBarSize={14} yDomains={yDomains}>
<Grid horizontal />
<SeriesBar
dataKey="orders"
fill="color-mix(in oklch, var(--chart-3) 30%, transparent)"
stroke="var(--chart-3)"
radius={3}
yAxisId="orders"
/>
<Band
upperKey="high"
lowerKey="low"
label="Expected"
curve={curveCatmullRom.alpha(0.42)}
fill="var(--chart-1)"
fillType="gradient"
fillOpacity={0.22}
strokeDasharray="3,4"
strokeOpacity={0.5}
/>
<Scatter dataKey="revenue" fill="color-mix(in oklch, var(--chart-2) 75%, transparent)" radius={3.5} />
<Line dataKey="trend" curve={curveCatmullRom.alpha(0.42)} stroke="var(--chart-1)" strokeWidth={2.5} />
<ChartTooltip />
<XAxis numTicks={6} />
</ComposedChart><ComposedChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} xDataKey="date" aspectRatio="3 / 2" barGap={0} maxBarSize={32}>
<Grid horizontal />
<SeriesBar dataKey="units" fill="var(--chart-3)" radius={5} />
<Line curve={curveMonotoneX} dataKey="revenue" stroke="var(--chart-1)" />
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={8} />
</ComposedChart>import { PatternPreset } from "@bklitui/ui/charts";
<ComposedChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} aspectRatio="3 / 2" barGap={0} maxBarSize={22}>
<PatternPreset
color="#e879f9"
id="composed-pat-fuchsia"
preset="diagonal-up"
/>
<Grid horizontal />
<SeriesBar dataKey="units" fill="url(#composed-pat-fuchsia)" stroke="#e879f9" />
<SeriesBar dataKey="runRate" fill="var(--chart-5)" />
<Line curve={curveMonotoneX} dataKey="revenue" stroke="var(--chart-1)" />
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={8} />
</ComposedChart><ComposedChart data={data} xDataKey="date" aspectRatio="3 / 2">
<Grid horizontal />
<SeriesBar dataKey="revenue" fill="var(--chart-1)" radius={4} />
<Area curve={curveMonotoneX}
dataKey="runRate"
dashArray="6,4"
dashFromIndex={4}
fill="var(--chart-4)"
fillOpacity={0.3}
showMarkers
/>
<Line curve={curveMonotoneX}
dataKey="runRate"
dashArray="6,4"
dashFromIndex={4}
showMarkers
stroke="var(--chart-2)"
strokeWidth={2}
/>
<ChartTooltip showCrosshair={false} />
<XAxis tickMode="data" />
</ComposedChart>const yDomains = {
volume: ([, max]) => [0, max * 4], // bars in the bottom quarter
right: ([min, max]) => [min - (max - min) * 0.45, max], // candles above them
};
<ComposedChart data={data} xDataKey="date" margin={{ top: 8, right: 72, bottom: 40, left: 8 }} aspectRatio="3 / 2" maxBarSize={10} yDomains={yDomains}>
<Grid horizontal />
<SeriesBar dataKey="volume" fill="var(--chart-3)" fadedOpacity={0.4} yAxisId="volume" />
<Candlestick yAxisId="right" widthRatio={0.55} />
<Line curve={curveMonotoneX} dataKey="ma5" stroke="var(--chart-1)" strokeWidth={1.5} yAxisId="right" />
<YAxis orientation="right" yAxisId="right" formatValue={(v) => `$${Math.round(v)}`} />
<ChartCrosshair yAxisId="right" numberFlow prefix="$" format={{ minimumFractionDigits: 2, maximumFractionDigits: 2 }} />
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={6} />
</ComposedChart><ComposedChart data={data} xDataKey="date" margin={{ top: 8, right: 8, bottom: 40, left: 48 }} aspectRatio="3 / 2">
<Grid horizontal />
<Scatter dataKey="signups" fill="var(--chart-2)" radius={4} />
<Line dataKey="avg7" stroke="var(--chart-1)" curve={curveMonotoneX} />
<TrendLine dataKey="signups" stroke="var(--chart-4)" strokeStyle="dashed" />
<YAxis />
<ChartCrosshair snap={false} numberFlow format={{ maximumFractionDigits: 0 }} />
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={6} />
</ComposedChart><ComposedChart data={data} xDataKey="date" aspectRatio="3 / 2" maxBarSize={18}>
<Grid horizontal />
<Band curve={curveMonotoneX} upperKey="upper" lowerKey="lower" label="Range" fill="var(--chart-2)" fillOpacity={0.18} />
<SeriesBar dataKey="actual" fill="var(--chart-3)" radius={3} />
<Line curve={curveMonotoneX} dataKey="forecast" stroke="var(--chart-2)" dashFromIndex={20} dashArray="5,4" />
<ChartTooltip />
<XAxis numTicks={6} />
</ComposedChart><ComposedChart data={data} xDataKey="date" margin={{ top: 8, right: 8, bottom: 40, left: 48 }} aspectRatio="3 / 2" maxBarSize={12}>
<Grid horizontal />
<SeriesBar dataKey="trades" fill="var(--muted-foreground)" fadedOpacity={0.5} yAxisId="right" />
<ProfitLossLine dataKey="pnl" curve={curveMonotoneX} fadeEdges strokeWidth={2} />
<YAxis yAxisId="left" />
<ChartTooltip />
<XAxis numTicks={6} />
</ComposedChart><ComposedChart data={data} xDataKey="date" margin={{ top: 8, right: 56, bottom: 40, left: 56 }} aspectRatio="3 / 2" stacked stackGap={3} barGap={0} maxBarSize={20}>
<Grid horizontal />
<SeriesBar dataKey="direct" fill="var(--chart-1)" radius={4} />
<SeriesBar dataKey="partner" fill="var(--chart-3)" radius={4} />
<Area curve={curveMonotoneX} dataKey="revenue" fill="var(--chart-2)" fillOpacity={0.15} yAxisId="right" />
<YAxis yAxisId="left" />
<YAxis orientation="right" yAxisId="right" />
<ChartTooltip />
<XAxis numTicks={6} />
</ComposedChart><ComposedChart data={data} xDataKey="date" margin={{ top: 8, right: 56, bottom: 40, left: 8 }} aspectRatio="3 / 2">
<Grid horizontal />
<Area dataKey="sessions" fill="var(--chart-3)" fillOpacity={0.2} curve={curveMonotoneX} />
<Scatter dataKey="signups" fill="var(--chart-1)" radius={3.5} strokeWidth={1.5} yAxisId="right" />
<YAxis orientation="right" yAxisId="right" />
<ChartTooltip />
<XAxis numTicks={6} />
</ComposedChart><ComposedChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} xDataKey="date">
<Background />
<SeriesBar dataKey="units" fill="var(--chart-3)" radius={4} />
<Line curve={curveMonotoneX} dataKey="revenue" stroke="var(--chart-1)" />
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={8} />
</ComposedChart><ComposedChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} xDataKey="date">
<Background pattern="dots" opacity={0.85} />
<SeriesBar dataKey="units" fill="var(--chart-3)" radius={4} />
<Line curve={curveMonotoneX} dataKey="revenue" stroke="var(--chart-1)" />
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={8} />
</ComposedChart><ComposedChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} xDataKey="date">
<ReferenceArea y1={95} y2={110} strokeStyle="dashed" showMarkers />
<SeriesBar dataKey="units" fill="var(--chart-3)" radius={4} />
<Line curve={curveMonotoneX} dataKey="revenue" stroke="var(--chart-1)" />
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={8} />
</ComposedChart><ComposedChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} xDataKey="date">
<ReferenceArea
y1={95}
y2={110}
pattern="diagonal-up"
patternColor="var(--chart-foreground-muted)"
axisLabelColor="var(--chart-1)"
fillOpacity={0.85}
/>
<SeriesBar dataKey="units" fill="var(--chart-3)" radius={4} />
<Line curve={curveMonotoneX} dataKey="revenue" stroke="var(--chart-1)" />
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={8} />
</ComposedChart><ComposedChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} xDataKey="date">
<Grid horizontal />
<SeriesBar dataKey="units" fill="var(--chart-3)" radius={4} />
<Line curve={curveMonotoneX} dataKey="revenue" stroke="var(--chart-2)" />
<TrendLine dataKey="revenue" stroke="var(--chart-1)" />
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={8} />
</ComposedChart><ComposedChart margin={{ top: 8, right: 8, bottom: 40, left: 8 }} data={data} xDataKey="date">
<Grid horizontal />
<SeriesBar dataKey="units" fill="var(--chart-3)" radius={4} />
<Line curve={curveMonotoneX} dataKey="revenue" stroke="var(--chart-2)" />
<TrendLine
dataKey="revenue"
strokeStyle="gradient"
gradientStart="var(--chart-3)"
gradientEnd="var(--chart-1)"
strokeWidth={2.5}
fadeEdges
/>
<ChartTooltip showCrosshair={false} />
<XAxis numTicks={8} />
</ComposedChart>