Identity and colors
Separate measured values, stable identities and presentation metadata.
| Name | Job | Example |
|---|---|---|
dataKey | Read a measured field or accessor | "visitors" reads each row's value |
seriesKey | Identify series metadata and visibility separately | "visitors" identifies an accessor series |
| Category identity | Identify one row/category independently of its value | "search" identifies a slice whose value is 35 |
config | Label, color, formatter and optional icon | visitors: { label: "Visitors", color: "#733bff" } |
Series
A string series dataKey normally identifies its config entry. Function and numeric keys need seriesKey for controlled visibility. Configured Line's series entries always supply unique keys in config. An accessor can change how a value is read without changing its identity:
"use client";
import * as Chart from "@kind-ui/charts";
import "@kind-ui/charts/styles.css";
const data = [{ month: "Jan", count: 42 }, { month: "Feb", count: 58 }];
const config = { visitors: { label: "Visitors", color: "#733bff" } };
export function AccessorChart() {
return <Chart.LineChart data={data} config={config} xDataKey="month"
series={[{ dataKey: (row) => row.count, seriesKey: "visitors" }]}
animate={false} aria-label="Monthly visitors" />;
}Series metadata supplies default paint; explicit native paint and custom renderers retain control. Configured Line toggles series automatically. defaultVisibleSeries sets the initial list; controlled visibility needs visibleSeries and onVisibleSeriesChange. Without the callback, the list is read-only. Keep the visibility mode stable or remount to change it.
Category and node colors
Try the short identity and layout recipes or the complete Components examples.
- Pie/Donut and Radial category defaults:
PieSeries.categoryKeyreads explicit series rows;RadialBarChart.categoryKeyreads chart rows. A row such as{ id: "search", value: 35 }usesdataKey="value"for geometry andcategoryKey="id"for config color. IDs must resolve to string keys inRoot.config; use an accessor for nested fields. Reorder/filter keeps color tied to identity. Legend order follows config order; category filtering stays application-owned. - Sankey metadata:
SankeyChart.nodeConfigmaps node IDs to labels/colors. Default nodes use their own color; solid links use the source color. Composed gradient links resolve both endpoints.SankeyLegendreceives the same config explicitly and remains a static list. - ActivityRings: ring
keyidentifies config;valueand optionaldomaindetermine progress. The helper supplies radial composition and preserves original values for its default tooltip. Explicit Radial composition remains available.
Category defaults fill missing native paint. Explicit series fill disables them; datum/Cell fill takes precedence. Existing Cell props/handlers and custom shapes remain authoritative. Overrides can intentionally differ from legend metadata; update config too when the legend should match. No positional palette or universal identity schema is implied.
Heatmap uses row/column identity and a quantitative scale, rather than series colors. Its compact layout adds HeatmapGrid.layout for cell size, gap and visual headers; accessible headers and keyboard navigation remain present.
Inspection and emphasis
Tooltip inspection and paint emphasis are separate contracts. Hiding series does not rewrite the dataset. Automatic emphasis is family-specific; custom renderers keep their own behavior. See the relevant Components page for supported inspection, legend and emphasis options.