Skip to Content
kindui

Troubleshooting

Fix the common problems with installing, sizing and composing charts.

Find the symptom below. If it isn't here, compare your chart with the first example on its chart page, which is complete.

Setup and Sizing

SymptomFix
@kind-ui/charts or motion doesn't resolveInstall the package with motion and recharts, as in Get Started; Motion is needed even with animate={false}. Import from @kind-ui/charts only, not its files
shadcn add can't find components.jsonRun npx shadcn@latest init first, then add the @kind-ui registry
The chart has no stylesAdd the @source line for the package to the stylesheet that imports Tailwind. Its path is relative to that file: from src/app/globals.css it's ../../node_modules/@kind-ui/charts/dist
A server component can't find LineChart.XAxisPut the chart in a file that starts with "use client"
The chart is blank or has no heightLeave height at its default, set a number, or give a percentage height a parent with a measured height
The chart pushes its flex or grid layout widerGive its parent min-width: 0
The last x-axis label is cut offPass margin={{ right: 16 }} to the chart
Series colors don't follow dark modeSet color-scheme on the page, and give the series { light, dark } colors
Two React roots on one page share colorsGive each root its own identifierPrefix

Composition

SymptomFix
The chart throws "requires aria-label or aria-labelledby"Name it; see Accessibility
The chart throws "do not nest chart families"Give each chart its own root, side by side
Nothing drawsAdd the parts as children: config names series but draws nothing
The legend highlights instead of hidingSet interaction to "visibility" mode with defaultVisibleSeries; see Legend
The chart throws about onVisibleSeriesChangePass visibleSeries or defaultVisibleSeries with it, but not both
A series has no label, color or legend itemIts dataKey or seriesKey must match a config key; see Identity
Colors move when rows are sortedGive each category a stable ID with categoryKey; see Identity
Arrow keys stay on the hovered pointMove the pointer out of the plot before using the keyboard
A material doesn't showA custom shape, fill or filter replaces it; see Materials
The entrance stops earlyHovering or new data finishes it; remount with a new key to replay; see Motion

Report a Problem

Open an issue on GitHub with the versions of @kind-ui/charts, React, Recharts and Motion you have installed, the smallest chart that shows the problem, and what you expected to happen.