Area Chart

TooltipBar Chart

A trend over time with a light wash under the line.

Weekly visitors
Last 8 weeks
weekvisitors
W13,120
W23,480
W33,310
W44,020
W54,390
W64,210
W74,880
W85,260

Installation

pnpm add krz-ui

Usage

import { AreaChart } from "krz-ui";
<AreaChart data={visitors} index="week" series={["visitors"]} title="Weekly visitors" />

API Reference

PropTypeDescription
curvedbooleanSmooth monotone curves. Default true.
dataRecord<string, string | number | null>[]One row per x-axis point.
indexstringKey of the x-axis label in each row.
series(string | { key, label?, color? })[]Value keys to plot. Colors follow the palette in order; pass `color` to pin one.
heightnumberPlot height in px. Default 240.
title / descriptionReactNodeCaption above the chart; also used for the accessible name.
valueFormatter(value: number) => stringFormats tooltip and table values.
tickFormatter(value: number) => stringFormats y-axis ticks. Default: comma'd, compact from 10k.
showLegendbooleanDefaults to shown for 2+ series.
tableTogglebooleanShow the “Show data” table toggle. Default true.
className / style / ref—All go to the outer <figure>. See Customization.
classNames{ header?, title?, description?, plot?, legend?, legendItem?, tableToggle?, table?, tooltip? }Extra classes for inner parts.