GitHubGitHub
← All widgets
Analytics / widget

Area chart

A lightweight inline SVG area trace with normalized values, gradient fill, endpoint, and empty state.

DataMissing valuesNot enough data
<AreaChart data={[12, 18, 16, 24]} label="Requests" />

Installation

pnpm add @chanrg/4ui

Import the stylesheet once, at the root of your app:

import '@chanrg/4ui/styles.css';

Usage

import { AreaChart } from '@chanrg/4ui';<AreaChart data={[12, 18, 16, 24]} label="Requests" />

API reference

Props

PropTypeDefaultDescription
dataArray<number | point | null>[]Values or value objects.
colorstringchart tokenTrace color.

CSS variables

VariableDescription
--4ui-surfacePrimary component surface.
--4ui-textPrimary foreground color.
--4ui-borderDefault control and panel border.

Accessibility

  • Exposes minimum and maximum in the image label.

Dependencies

numericValue