structyl

The full prop reference for the Chart component. A comprehensive custom SVG chart library with 45+ components — bar, line, area, pie/donut, scatter, bubble, radar, heatmap, treemap, funnel, gauge, candlestick, radial bar, radial line, sankey, waterfall, gantt, boxplot, sunburst, chord, histogram, and more. No external charting dependency.

Import

tsx
import { Chart } from '@structyl/styled';

Props

Chart.Root

Cartesian chart container. Compose Bar, Line, Area, Scatter and Bubble inside.

PropTypeDefault
data#Record<string, unknown>[]

Array of data objects.

height#number

SVG height in pixels.

300
width#number

SVG width. Omit for responsive layout.

margin#{ top, right, bottom, left }

Inner margin for axes.

{ top:10, right:10, bottom:30, left:40 }
accessibilityLabel#string

Sets aria-label on the SVG.

accessibilityMode#boolean

Enables pattern fills for colorblind accessibility.

false

Chart.Bar

Vertical (or horizontal) bar series inside Chart.Root.

PropTypeDefault
dataKey#string

Required. Field name in data.

name#string

Display name in legend and tooltip.

color#string

Override color.

stackId#string

Bars with the same stackId are stacked.

radius#number

Corner radius.

2
orientation#'vertical' | 'horizontal'

Bar direction.

'vertical'

Chart.Line

Line series inside Chart.Root.

PropTypeDefault
dataKey#string

Required. Field name in data.

name#string

Display name.

color#string

Override color.

curve#'linear' | 'catmullRom' | 'step'

Line interpolation.

'linear'
dot#boolean

Show data point dots.

true
strokeWidth#number

Line stroke width.

2

Chart.Area

Filled area series inside Chart.Root. Accepts all Chart.Line props plus fillOpacity and stackId.

PropTypeDefault
dataKey#string

Required. Field name in data.

fillOpacity#number

Fill transparency (0–1).

0.2
stackId#string

Areas with the same stackId are stacked.

Chart.Pie / Chart.PieRoot

Pie or donut chart. Wrap Chart.Pie in Chart.PieRoot.

PropTypeDefault
dataKey#string

Required. Numeric value field.

nameKey#string

Label field for segments.

innerRadius#number

Inner radius (> 0 = donut).

0
padAngle#number

Gap between segments in radians.

cornerRadius#number

Rounded segment corners.

colors#string[]

Per-segment color overrides.

Chart.Radar / Chart.RadarRoot

Radar/spider chart. Wrap Chart.Radar(s) in Chart.RadarRoot.

PropTypeDefault
dataKey#string

Required. Numeric value field to plot.

name#string

Display name.

color#string

Override color.

fillOpacity#number

Fill transparency.

0.25

Chart.Heatmap

Standalone heatmap grid. xKey, yKey and valueKey map data fields to cells.

PropTypeDefault
data#Record<string, unknown>[]

Required.

xKey#string

Required. Horizontal axis field.

yKey#string

Required. Vertical axis field.

valueKey#string

Required. Numeric intensity field.

width#number

SVG width.

500
height#number

SVG height.

280

Chart.Treemap

Standalone treemap using the squarify algorithm. Supports nested children.

PropTypeDefault
data#TreemapNode[]

Required. Hierarchical data with name, value and optional children.

width#number

SVG width.

500
height#number

SVG height.

350

Chart.Funnel

Standalone funnel chart rendered top-down.

PropTypeDefault
data#{ name: string; value: number }[]

Required. Stages in descending order.

width#number

SVG width.

400
height#number

SVG height.

300

Chart.Gauge

Standalone half-circle arc gauge.

PropTypeDefault
value#number

Required. Current value.

min#number

Minimum value.

0
max#number

Maximum value.

100
width#number

SVG width.

240
height#number

SVG height.

180
label#string

Text shown in center of arc.

Chart.Candlestick

Standalone OHLC candlestick chart.

PropTypeDefault
data#OhlcEntry[]

Required. Objects with open, high, low, close.

width#number

SVG width.

600
height#number

SVG height.

300
bullColor#string

Color for bullish (close > open) candles.

hsl(var(--chart-2))
bearColor#string

Color for bearish (close < open) candles.

hsl(var(--chart-5))

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library