Charts

DrumKit ships no chart component — just what recharts asks for: legend, tooltip, active dot, and tick thinning. The plot itself is composed at the call site.

Demo

hero
Component
legend
marker
import { Area, CartesianGrid, ComposedChart, Legend, Line, ResponsiveContainer, Tooltip, XAxis, YAxis } from "recharts"; import { ChartActiveDot, ChartLegendContent, ChartTooltipContent, selectEvenlySpacedItems } from "@/components/application/charts/charts-base"; // data: { month, desktop, mobile, tablet }[] — 36 months, so the // sampler thins the axis to seven ticks. The wash under the lead // series is a <linearGradient> in <defs>, its color at 8% fading to 0. <ResponsiveContainer width="100%" height={240}> <ComposedChart data={data}> <CartesianGrid vertical={false} className="stroke-border-secondary" /> <XAxis dataKey="month" tickLine={false} axisLine={false} ticks={selectEvenlySpacedItems(months, 7)} interval={0} padding={{ right: 28 }} // keeps the centered end label inside the svg className="text-tertiary" tick={{ className: "fill-current text-xs" }} /> <YAxis width={40} tickLine={false} axisLine={false} className="text-tertiary" tick={{ className: "fill-current text-xs" }} /> <Tooltip isAnimationActive={false} cursor={{ className: "stroke-utility-brand-600", strokeWidth: 2, strokeLinecap: "round" }} // the sheet's marker cursor content={<ChartTooltipContent />} /> <Legend verticalAlign="top" align="right" content={<ChartLegendContent align="right" className="pb-4" />} /> <Area dataKey="desktop" name="Desktop" className="text-utility-brand-600" stroke="currentColor" strokeWidth={2} fill="url(#wash)" dot={false} isAnimationActive={false} activeDot={(dot) => <ChartActiveDot cx={dot.cx} cy={dot.cy} />} /> {/* Mobile and Tablet: the same Line at brand-400 and brand-700 */} </ComposedChart> </ResponsiveContainer>

In context

in-context

Family

family
  • Desktop
  • Mobile
ChartLegendContent

Dec 2025

Desktop: 5,310

Mobile: 2,960

ChartTooltipContent
ChartActiveDot
Jan · Mar · May · Jul · Sep · Nov · Dec
selectEvenlySpacedItems

Types

cells

The five charts the sheet draws, and its three markers.

Charts

line frame: three series, the lead one washed
bar frame: three stacked series, rounded tops
pie at md: six slices, legend right
Active users8,270
activity gauge at md: three rings, number centred
radar: seven axes, three series, value pills

Markers

Line: the kit's ChartActiveDot on a solid cursor
Dash: a solid dot on a dotted cursor
Minimal: no dot, a value-only bubble

Sizes

cells

Pie

xxs, 120px
xs, 160px
sm, 200px
md, 240px
lg, 280px

Activity gauge

Active users8,270
xs, 160px box, 8px rings
Active users8,270
sm, 200px box, 12px rings
Active users8,270
md, 240px box, 16px rings
Active users8,270
lg, 280px box, 18px rings

Layouts

cells

Legend list

  • Desktop
  • Mobile
  • Tablet
horizontal, align left
  • Desktop
  • Mobile
  • Tablet
horizontal, align center
  • Desktop
  • Mobile
  • Tablet
horizontal, align right
  • Desktop
  • Mobile
  • Tablet
vertical
  • Desktop
  • Mobile
  • Tablet
vertical, align center
  • Tablet
  • Mobile
  • Desktop
horizontal, reversed

Frame legend

legend top
legend right
legend bottom
no legend

Axis titles

line frame with axis titles
bar frame with axis titles

Gauge legend

Active users8,270
no legend
Active users8,270
  • Desktop
  • Mobile
  • Tablet
legend bottom
Active users8,270
  • Desktop
  • Mobile
  • Tablet
legend right

Radar legend

legend bottom
legend right
no legend

Content

cells

Tooltip

Dec 2025

Desktop: 5,310

Mobile: 2,960

two entries: the label as title, a row per series

8,270

Dec 2025

one entry: the value as title, the label under it

2,960

Mobile web, unauthenticated sessions in the EU region

a long supporting line, capped at max-w-74

38%

Organic search

one slice, isPieChart: the slice name under the value

83%

Desktop

one ring, isRadialChart: the ring name under the value

Legend labels

  • Mobile web, unauthenticated
  • Desktop
a wrapping label, the swatch on its first line
  • desktop
  • mobile
series without a name: raw dataKeys
  • Desktop
  • Mobile
  • Tablet
entries without a className: text-tertiary swatches

Behaviour

cells

Tick sampling

Jan · Mar · May · Jul · Sep · Nov · Dec
twelve months to seven ticks
2 · 6 · 10 · 14 · 18 · 22 · 26 · 30
fifteen desktop day ticks to eight
1 · 5 · 9 · 13 · 17 · 21 · 25 · 30
thirty daily labels to eight, every pick distinct
Mon · Tue · Wed · Thu · Fri · Sat · Sun
seven days to seven, the identity
Q1 · Q2 · Q3 · Q4 · Q4 · Q4 · Q4 · Q4
four labels at eight ticks: the last repeats

Loading

cells

Shapes

Loading chart
type plot: legend, plot block and axis ticks
Loading chart
type circle: a circle beside its legend

States

cells
hover, pinned open; the pointer moves it
focus, live: tab to the chart, arrow keys move the point
the active dot at rest
the active dot, ring recoloured through className