Recharts

Composable charting library built on React components

chart

React-first API with D3 under the hood. Highly customizable.

ReactChartsD3SVG

๐ŸŽฎ Playground

import { LineChart, Line, XAxis, YAxis } from "recharts"

const data = [
  { name: "Jan", value: 400 },
  { name: "Feb", value: 300 },
  { name: "Mar", value: 600 }
]

export default function Demo() {
  return (
    <LineChart width={400} height={300} data={data}>
      <XAxis dataKey="name" />
      <YAxis />
      <Line type="monotone" dataKey="value" />
    </LineChart>
  )
}
Use cases
  • โ€ขDashboards
  • โ€ขAnalytics
  • โ€ขReports
Good for
  • โœ“React applications
  • โœ“Customizable charts
  • โœ“Responsive designs
Not good for
  • โœ—Very complex 3D visualizations
  • โœ—Non-React projects
Installation
$ npm install recharts
Example
import { LineChart, Line, XAxis, YAxis } from "recharts"

const data = [
  { name: "Jan", value: 400 },
  { name: "Feb", value: 300 },
  { name: "Mar", value: 600 }
]

export default function Demo() {
  return (
    <LineChart width={400} height={300} data={data}>
      <XAxis dataKey="name" />
      <YAxis />
      <Line type="monotone" dataKey="value" />
    </LineChart>
  )
}
Comparison

"Easier React integration than Chart.js, simpler API than D3 direct use."

Trust Metrics

24K

GitHub Stars

3.1M

Weekly Downloads

Last Commit:last year
Used by
AirbnbLyftCoursera