Charts

Line & area chart

Lines that grow in when they scroll into view and spring between datasets with a liquid overshoot. A crosshair snaps to the nearest point; one glass tooltip lists every series.

Paste it into ChatGPT, Claude, Cursor or v0.
curve
series2

Usage

React
import { AreaChart, LineChart } from '@vizzele/react';

<AreaChart
  title="Visitors per month"
  data={[
    { month: 'Jan', web: 4200, app: 2100 },
    { month: 'Feb', web: 5100, app: 2600 },
    { month: 'Mar', web: 4800, app: 3400 },
  ]}
  index="month"
  series={[
    { key: 'web', label: 'Web' },
    { key: 'app', label: 'App' },
  ]}
/>

Props

PropTypeDefaultDescription
dataChartRow[]—One object per x position.
indexstring—Key holding the x value (category or date).
seriesChartSeries[]—{ key, label?, color? } — up to five, colored in the palette’s fixed order (never cycled).
titlestring—Accessible name and caption of the data table.
heightnumber260Plot height in px.
valueFormatter(v: number) => stringcompactFormats ticks, labels, tooltip and table (1,284 / 12.9K).
xFormatter(x) => string—Formats the x labels.
legendboolean≥ 2 seriesShow the legend.
yMaxnumber—Fix the top of the y scale.
areabooleanfalseWash under each line.
curve'smooth' | 'linear''smooth'Monotone curve never overshoots the data.
endLabelsboolean≤ 4 seriesValue at the end of each line; skipped when labels would collide.

Accessibility

  • The plot is focusable: ←/→ walk the points (Home/End jump) and a polite live region reads each one.
  • Every value is also in a visually hidden <table>, so nothing is gated behind hover.
  • Identity never relies on color alone: legend for 2+ series, direct labels when they fit.
  • The palette is validated for color-vision deficiency and contrast in both themes.