TanStack
TanStack

Charts

A chart grammar you don't have to outgrow.

TanStack Charts 0.3.1 is on npm. A compact React line consumer is 16.48 KiB gzip; its framework-neutral scene is 8.12 KiB.

Docs

Apple stock line with seasonal gaps

trend

All mark, no chart.

Just a few examples. The possibilities are endless.

Apple stock line with seasonal gaps

trend

Industry unemployment with end labels

trend

San Francisco temperature range band

range

Industry unemployment stacked area

composition

Sorted vertical bars

bar

Horizontal ranking with long labels

bar

Grouped bars

bar

Stacked bars

bar

Bubble scatterplot

relationship

Histogram

distribution

Labeled ordinal heatmap

matrix

Anscombe quartet small multiples

small multiples

Open-to-close price intervals

interval

Point estimates with error bars

uncertainty

Grouped boxplot

distribution

Ranked lollipop chart

comparison

Dumbbell comparison

comparison

Cumulative histogram

distribution

San Francisco temperature moving averages

trend

Industry share of unemployment

composition

Streamgraph

composition

Bollinger band

trend

Quantitative binned heatmap

distribution

Calendar heatmap

time

Diverging Likert responses

survey

Parallel coordinates

multivariate

Candlestick chart

financial

Annual gasoline-price waterfall

composition

Two-period slopegraph

change

Scatterplot with linear regression

relationship

Metro inequality change arrows

change

Apple close versus moving average

change

Pointer-selected tooltip

interaction

Grouped X tooltip

interaction

Tidy hierarchy tree

hierarchy

Delaunay spatial network

spatial

Filled wind-speed contours

spatial

Point density contours

distribution

Westport House floor plan

geography

Les Misérables character network

network

English letter frequency waffle

part-to-whole

Two-dimensional vector field

spatial

Hexagonally binned density

distribution

Framed guide-free scatterplot

decoration

Empirical cumulative distribution

distribution

Faceted distributions

small multiples

Beeswarm distribution

distribution

Log-scale Flare class sizes

relationship

Industry unemployment bump chart

ranking

Indexed industry unemployment

trend

Directed connected scatterplot

relationship

Scatterplot with marginal histograms

distribution

Annotated AAPL extrema

trend

Mean penguin mass reducer bars

bar

AAPL lag-one autocorrelation

relationship

Industry unemployment percentile ribbon

uncertainty

Ridgeline density comparison

distribution

Violin distribution comparison

distribution

Marimekko survey composition

part-to-whole

Voronoi nearest-point interaction

interaction

Layered Seattle weather chart

composition

Palmer penguins by species and sex

comparison

Stacked and adjacent Seattle weather bars

comparison

Automobile specifications scatter

performance

Flare analytics treemap

hierarchy

Simple radar chart

polar

English letter frequency pie

polar

English letter frequency donut

polar

Survey agreement share gauge

polar

Snapped axis pointer with grouped tooltip

interaction

Interactive series legend

interaction

Linked chart and data table selection

interaction

Focus and context time window

interaction

Pinned penguin tooltip with a nested chart

interaction

Scrollable resource timeline lanes

interaction

Streaming window preservation

interaction

Synchronized cursors across views

interaction

Free cursor over car measurements

interaction

Observed monthly AAPL brush selection

interaction

Wheel zoom and pan over AAPL closes

interaction

AAPL close playback scrubber

interaction

Editable event range

interaction

Letter frequency pie with labels

polar

Letter frequency donut with total

polar

Rounded letter frequency donut

polar

Nested Flare package sizes

polar

English letter frequency rose

polar

County unemployment gauge

polar

Comparative radar chart

polar

Concentric letter frequency bars

polar

Flare analytics sunburst

hierarchy

World learning-poverty choropleth

geography

World population bubble map

geography

Orthographic globe with graticule

geography

HMS Beagle voyage

geography

Seattle daily high-temperature polar line

polar

Surface wind polar scatter

polar

World population-density choropleth

geography

United States county unemployment choropleth

geography

Standard world projection gallery

geography

Basic Sankey

network

Sankey

network

Type Safe & Declarative for both Humans & Agents

Every example compiles under strict TypeScript. Fields, datum types, inferred domains and keys, tooltips, and focus callbacks stay connected to the source datum; the type suite rejects invalid definitions.

account-health.ts
const accountHealth = defineChart({
  marks: [
    dot(accounts, {
      x: 'monthlyRevenue',
      y: 'retention',
      r: 'seats',
      z: 'segment',
      key: 'id',
    }),
  ],
  x: {
    scale: scaleLinear(),
    label: 'Monthly revenue ($k)',
  },
  y: {
    scale: scaleLinear(),
    label: '90-day retention',
    format: (value) => percent.format(value),
  },
  tooltip: true,
})

Account health

Example account dataset · Q2 2026

Which high-revenue accounts need retention attention?

EnterpriseGrowthSMBBubble size = seats
Illustrative account data. Horizontal position shows monthly revenue in thousands of dollars, vertical position shows 90-day retention, color distinguishes SMB, Growth, and Enterprise segments, and bubble area represents account count.

Make it look like your product.

Same data and scales. CSS variables, themes, mark props, custom tooltips, or your own renderer control the rest.

Editorial

Product

Terminal

Monokai

16.48 KiB for a compact React line.

The framework-neutral scene is 8.12 KiB and retains neither D3 nor InternMap. For an apples-to-apples comparison, the pinned 12-case suite measures full cold-page browser bundles; Bklit's interactive line is included alongside the published library ranges.

Cold-page bundle comparison

Published 12-chart ranges; Bklit is an interactive line · minified + gzip

TanStack Charts26.6–32.1 KiB
Chart.js44.7–58.2 KiB
Observable Plot83.3–91.9 KiB
Bklit152.1 KiB
Recharts153.1–168.3 KiB
Apache ECharts153.1–173.2 KiB

Layer marks over shared scales.

Area, rules, lines, points, and labels share one coordinate system. The definition beside the chart is the whole composition.

Weekly activation rate

Jan–May 2026 · illustrative product telemetry

78%

above 70% goal

ActivationExpected rangeGoalReleases
Illustrative weekly activation data from January through May 2026. The actual rate rises from 48 to 78 percent, compared with an expected range and a 70 percent goal. Onboarding v2 and Invite flow are marked as release events.
activation-chart.ts
import { curveMonotoneX, scaleLinear, scaleUtc } from 'd3'
import {
  areaY,
  d3Curve,
  defineChart,
  dot,
  lineY,
  ruleY,
  text,
} from '@tanstack/charts'

import { releases, weeks } from './activation-data'
import { activationTheme } from './activation-theme'

const monthDay = new Intl.DateTimeFormat('en-US', {
  day: 'numeric',
  month: 'short',
  timeZone: 'UTC',
})

export const activationChart = defineChart({
  marks: [
    areaY(weeks, {
      id: 'activation-range',
      x: 'date',
      y1: 'expectedLow',
      y2: 'expectedHigh',
      key: 'id',
      fill: 'var(--activation-range)',
      fillOpacity: 0.22,
      curve: d3Curve(curveMonotoneX),
    }),
    ruleY([70], {
      id: 'activation-goal',
      stroke: 'var(--activation-goal)',
      strokeOpacity: 0.95,
      strokeWidth: 2,
      strokeDasharray: '7 7',
    }),
    lineY(weeks, {
      id: 'activation-line',
      x: 'date',
      y: 'activation',
      key: 'id',
      stroke: 'var(--activation-line)',
      strokeWidth: 4.25,
      points: true,
      curve: d3Curve(curveMonotoneX),
    }),
    dot(releases, {
      id: 'activation-events',
      x: 'date',
      y: 'activation',
      key: 'id',
      r: 6,
      fill: 'var(--activation-bg)',
      stroke: 'var(--activation-release)',
      strokeWidth: 3,
    }),
    text(releases, {
      id: 'activation-event-labels',
      x: 'date',
      y: 'activation',
      text: 'label',
      key: 'id',
      fill: 'var(--activation-foreground)',
      fontSize: 12,
      fontWeight: 650,
      dy: -21,
    }),
  ],
  x: {
    scale: scaleUtc().domain([weeks[0]!.date, weeks.at(-1)!.date]),
    axis: {
      label: 'Week ending',
      ticks: { format: (value) => monthDay.format(value) },
    },
    grid: false,
  },
  y: {
    scale: scaleLinear().domain([40, 82]),
    axis: {
      label: 'Activation rate (%)',
      ticks: { count: 5, format: (value) => `${Math.round(value)}%` },
    },
    grid: true,
  },
  theme: activationTheme,
})

TanStack Charts builds on Leland Wilkinson's grammar of graphics and the work of ggplot2, Vega-Lite, and Observable Plot. Its marks-and-channels API is most directly inspired by Observable Plot, but the runtime is an independent implementation.

Partners

Gold
CodeRabbit
Cloudflare
Netlify
Railway
Lovable
Silver
Clerk
OpenRouter
AG Grid
SerpApi
WorkOS
Bronze
Electric
Sentry
Prisma
Unkey
OSS Sponsors

Sponsors get special perks like private discord channels, priority issue requests, and direct support!