Skip to main content

React Chart Components

A chart that lies is worse than no chart. Choose the library that makes honest data easy and misleading data hard.

Most apps need three chart types: line, bar, and pie. If your library makes those hard, you picked wrong.

Library Selection

CriteriaRechartsNivoChart.js (react-chartjs-2)TremorD3 (raw)
Bundle size~45 KB~60 KB~30 KB~20 KB (Tailwind)~75 KB
Built onD3 + SVGD3 + SVG/CanvasCanvasRechartsItself
React-nativeDeclarativeDeclarativeWrapperDeclarativeManual
Server renderingSVG (yes)SVG (yes)Canvas (no)SVG (yes)SVG (yes)
InteractivityGoodExcellentGoodBasicUnlimited
AccessibilityPartialGoodPartialGoodManual
Best forStandard dashboardsRich, themed chartsLightweight canvasTailwind projectsCustom visualizations

Decision Rule

SituationChoiceWhy
Tailwind design systemTremorNative Tailwind, minimal config
Standard business chartsRechartsProven, large ecosystem
Need SSR chartsNivo or RechartsSVG renders server-side
Highly custom vizD3Nothing else gives full control
Minimal bundle budgetChart.jsSmallest with canvas rendering

Context

  • Metrics — What the charts should measure
  • Components — Charts are components with data contracts
  • Tailwind — Tremor and chart theming
  • Performance — Charts are heavy; lazy load them
  • Design — Charts must meet visual design standards

Questions

When does a table outperform a chart for the same data?

  • What chart type is most commonly misused for the data it shows?
  • How do you make charts accessible to screen readers?
  • When does real-time chart updating justify the WebSocket cost?