Skip to content
synccn

Area Chart

Smooth area with a crosshair tooltip.

Weekly active users

Last 18 weeks

6,100

Installation

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

First time in this project? Connect synccn with one command.

Usage

import { AreaChart } from "@/components/ui/charts";<AreaChart data={series} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

AreaChart

Area chart with a crosshair tooltip. data: [{ label, value }]

  • datarequired
    ChartDatum[]

    Points, in order.

  • height
    number

    Default 200

    Chart height in pixels.

  • format
    (value: number) => React.ReactNode

    Default (v) => v

    Formats the tooltip value.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA roles: img, meter
  • ARIA attributes: aria-label, aria-pressed, aria-valuemax, aria-valuemin, aria-valuenow