Ballmac UI home

Chart Area

An area chart with gradient, solid or no fill, stacked or expanded to 100%, four curves and reference lines, in a frame with a table view, a legend that toggles series, patterns for color blindness and loading, empty and error states.

6/6 checksv1.0.0Updated Oct 18, 2026
What changed

Visitors

Desktop and mobile, January to June

6 points. Desktop: from 4,210 in Jan to 6,480 in Jun; highest 6,480 in Jun, lowest 4,210 in Jan. Mobile: from 2,480 in Jan to 6,140 in Jun; highest 6,140 in Jun, lowest 2,480 in Jan.

Installation

$ pnpm dlx shadcn@latest add @ballmac/chart-area

Usage

import { ChartArea } from "@/components/ballmac/chart-area"

The full example is in the Code tab above.

Examples

Stacked

Monthly recurring revenue

By plan, stacked

8 points. Pro: from $9,400 in Mar to $18,200 in Oct; highest $18,200 in Oct, lowest $9,400 in Mar. Team: from $6,200 in Mar to $18,400 in Oct; highest $18,400 in Oct, lowest $6,200 in Mar.
Team passed Pro in October.

Expanded to 100%

Traffic mix

Each channel's share of weekly visitors

6 points. Search: from 3,100 in W1 to 4,210 in W6; highest 4,210 in W6, lowest 3,100 in W1. Direct: from 1,900 in W1 to 2,200 in W6; highest 2,200 in W6, lowest 1,900 in W1. Social: from 800 in W1 to 1,630 in W6; highest 1,630 in W6, lowest 800 in W1. Email: from 520 in W1 to 820 in W6; highest 820 in W6, lowest 520 in W1.

Step

Queue depth

Jobs waiting, sampled through the day

9 points. Jobs waiting: from 12 in 00:00 to 14 in 22:00; highest 91 in 14:00, lowest 8 in 04:00.

Linear with dots

New signups

Per week

6 points. Signups: from 212 in Sep 7 to 322 in Oct 12; highest 340 in Oct 5, lowest 212 in Sep 7.

Patterns for color blindness

Requests by client

Switch Patterns on to tell the series apart without color

7 points. API: from 1,840 in Mon to 1,410 in Sun; highest 2,480 in Fri, lowest 1,410 in Sun. Web: from 1,260 in Mon to 870 in Sun; highest 1,510 in Fri, lowest 870 in Sun. Mobile: from 720 in Mon to 1,290 in Sun; highest 1,340 in Sat, lowest 720 in Mon.

Reference line and footer

Uptime

Monthly, against the 99.9% target

6 points. Uptime: from 99.91% in May to 99.98% in Oct; highest 99.99% in Aug, lowest 99.82% in Jul.
Above target in five of six months.

With a range picker

Visitors

The last 90 days

90 points. Desktop: from 380 in Jul 1 to 637 in Sep 28; highest 696 in Sep 21, lowest 304 in Jul 12. Mobile: from 298 in Jul 1 to 588 in Sep 28; highest 674 in Sep 19, lowest 272 in Jul 13.

Loading, empty and error

Orders

Per month

Loading Orders

API reference

PropTypeDefault
curve

How the line moves between points.

"monotone" | "linear" | "step" | "natural""monotone"
stack

"stacked" adds the series up; "expanded" shows each one's share of the total, as a percentage.

"none" | "stacked" | "expanded""none"
fillMode

What fills under each line.

"gradient" | "solid" | "none""gradient"
dots

Draw a dot on every point.

booleanfalse
grid

Which grid lines to draw.

"horizontal" | "both" | "none""horizontal"
yAxis

Show the value axis.

booleantrue
yFormatter

Writes a tick on the value axis. Defaults to a compact number (12K).

(value: number) => string—
yDomain

Fix the value axis, for example `[0, 100]`.

[number | "auto", number | "auto"]—
referenceLines

Horizontal lines at fixed values, such as a target or a limit.

{ y: number; label: string }[]—
tooltip

The marker style in the tooltip, or "none" to hide the tooltip.

"line" | "dot" | "dashed" | "none""line"
y*number—
label*string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Arrow keysMove between data points (accessibilityLayer)
Tab, Enter / SpaceLegend buttons switch series; the Chart / Table switch shows the same data as a table

Quality scorecard

6/6

Every applicable check passes

Measured in Chromium 153.0.8010.12 on October 19, 2026, on version 1.0.0, across 9 examples.

How we measure
  • Passed: Accessibility scan

    No serious or critical issues in light and dark, on a phone and a desktop (axe-core 4.13.0, WCAG 2.1 AA and best-practice rules).

  • Passed: Small screens

    No sideways scrolling at 360, 390 or 1280 px wide.

  • Passed: Reduced motion

    Every endless animation stops when the visitor asks for less motion.

  • Not applicable: Right to left

    Not mirrored by design: Recharts draws its axes in SVG coordinates, which do not mirror.

  • Passed: Clean console

    No console errors or React hydration errors while loading.

  • Passed: Keyboard

    32 tab stops, each showing a visible change when it takes focus. 2 documented keys.

  • Not applicable: Loading, empty and error

    Does not show data or take submissions.

  • Passed: Automated tests

    Covered by charts-batch-families.test.tsx.

  • For information: Footprint

    2.2 KB of source (gzip) in 1 file. Installs recharts.

Automated checks find a subset of problems and do not replace testing with a screen reader and a keyboard in your own app. What they miss.

Use with AI

<ChartArea title description data xKey series={[{ key, label, color? }]} />. curve: monotone | linear | step | natural. stack: none | stacked | expanded (percent). fillMode: gradient | solid | none. Also dots, grid, yFormatter, yDomain, referenceLines, tooltip, legend, patterns, state and every ChartFrame prop. Colors come from the theme's chart colors in order. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Chart Area (@ballmac/chart-area) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Trends over time, especially more than one series
  • Part-to-whole over time (stacked or expanded)

Not for

  • Comparing a few categories (use chart-bar)
  • Exact values matter more than shape (use chart-line with dots or the table view)

Registry JSON: https://ui.ballmac.com/r/chart-area.json

Credits

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.