Props and types
Every chart requires title and data. Everything else is optional.
| Prop | Type | Default | Notes |
|---|---|---|---|
title | string | required | The chart's accessible name. |
data | see Charts | required | Input arrays are never mutated. Order is preserved. |
description | string | none | Extra context for screen readers. |
height | number | 280 | Minimum 100. |
color | string | Lagoon teal | Primary series color. |
colors | string[] | built-in palette | Palette for pie, donut, funnel and treemap. |
variant | 'flat' | 'pixel' | '3d' | 'flat' | See Styles. |
animate | boolean | true | Reduced-motion preferences always win. |
formatValue | (value: number) => string | Intl.NumberFormat | Applies to labels, captions and tables. |
className | string | none | Added to the chart root. |
Histogram also takes bins. WaterfallChart also takes negativeColor.
TypeScript
Prop types are exported: ChartProps, CategoryChartProps, HistogramProps, ScatterChartProps, BubbleChartProps, HeatmapProps, WaterfallChartProps, plus ChartKind, ChartVariant and the datum types Datum, Point, Bubble, HeatmapCell, WaterfallDatum.
Helpers
Three pure functions are exported for drawing your own marks: histogram, treemap and waterfall.