Components › Charts

Bar chart

Rounded bars on a track. Bars grow in; hover or focus a bar for its value.

Installation

npx plankui@latest add bar-chart

Usage

import { BarChart } from "@/components/ui/bar-chart";

<BarChart data={[{ label: "Mon", value: 420 }, { label: "Tue", value: 380 }]} highlight={1} />

API reference

PropTypeDefaultDescription
data{ label: string; value: number }[]requiredBars.
highlightnumberIndex drawn in the full accent.
format(n: number) => stringAxis and tooltip format.
height / ticksnumber200 / 4Plot height and guide lines.

View the source on GitHub