RE

Recharts

recharts

React charts

Charts
react
reactjs
chart
react-component
recharts
Charts
javascript
npm
frontend
open source
Stars
1
Weekly
0
Open issues
0
Bundle
~60 kB

Installation

npm install recharts

Code example

import { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer } from "recharts";

const data = [
  { name: "Mon", value: 12 },
  { name: "Tue", value: 18 },
  { name: "Wed", value: 9 },
];

export function Example() {
  return (
    <div style={{ width: "100%", height: 240 }}>
      <ResponsiveContainer>
        <LineChart data={data}>
          <XAxis dataKey="name" />
          <YAxis />
          <Tooltip />
          <Line type="monotone" dataKey="value" stroke="currentColor" />
        </LineChart>
      </ResponsiveContainer>
    </div>
  );
}

Pros & cons

Pros

  • Actively maintained by recharts group
  • 0 weekly downloads. Battle tested
  • First-class TypeScript definitions
  • MIT licensed

Considerations

  • Adds roughly ~60 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 0 open issues on GitHub

FAQs

Alternatives & similar libraries