ThiloDesign System
DV

Chart

shadcn/ui
Recharts

Recharts wrapper with semantic token support. Area, Line, Bar, and Pie — all reading from ChartConfig.

@/components/ui/chart

Area + Line — ticket volume trend

Stacked area

Open, Closed, Blocked per month

Line chart

Trend comparison without fill

Bar — priority distribution

Vertical bars

Ticket count by priority

Horizontal bars

Rotated axis for long labels

Pie + Donut — status breakdown

Pie chart

Ticket distribution by status

Donut chart

Same data with inner radius

Chart type — when to use

TypeUse forRecharts primitives
AreaVolume trends over time (tickets created, closed)AreaChart + Area
LineComparison trends without fill — cleaner for 3+ seriesLineChart + Line
Bar (V)Counts by category (priority, department)BarChart + Bar
Bar (H)Long category names, ranking order (use layout='vertical')BarChart layout='vertical'
PiePart-of-whole — status breakdown, category sharePieChart + Pie
DonutSame as Pie but with space for a center KPI numberPieChart + Pie innerRadius

Chart color tokens

--chart-1var(--chart-1)
--chart-2var(--chart-2)
--chart-3var(--chart-3)
--chart-4var(--chart-4)
--chart-5var(--chart-5)

Always reference chart colors via CSS variables (var(--chart-N)) — never hardcode. Both light and dark values are defined in globals.css.

Sub-components

ComponentRole
ChartContainerRoot wrapper — binds ChartConfig and sets CSS color variables for Recharts
ChartTooltipRecharts Tooltip wrapper — must pass content={<ChartTooltipContent />}
ChartTooltipContentStyled tooltip panel — reads config for labels and colors
ChartLegendRecharts Legend wrapper — must pass content={<ChartLegendContent />}
ChartLegendContentStyled legend row — nameKey prop matches the config key to label display

ChartConfig maps your data keys to display labels and colors. The config is read by ChartTooltipContent and ChartLegendContent to render styled labels automatically.

On this page