Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 3 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

Recharts

Composable React component library for building responsive charts.

Charts and data visualisationNPM

GitHubWebsite

1. License

License from npm.

github.com/recharts/recharts

From the package registry and GitHub, checked daily. Tap a verdict to see its source.How we checkedReport an error

What Recharts does

Recharts treats each part of a chart (axis, tooltip, grid, line) as its own React component, and draws the assembled chart as SVG.

Recharts popularity

85 / 100
Gid Score, #43 overall
71.4M
downloads a week, npm
27.7K
GitHub stars
576
agent projects use it
Recharts: downloads per weeknpm, recharts 71,353,674
Recharts: GitHub starsrecharts/recharts 27,741

Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated

How Recharts is used

  • Recharts is a dependency in 576 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (11.8% of the 4,867 JavaScript/TypeScript ones), #1 of 95 in charts and data visualisation.
  • Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 2,129; those are left out of every share on this page.
  • The most used alternative in our scan is Chart.js (88 projects).
  • Projects that use it most often also use Lucide React (92.7%), clsx (86.3%), Tailwind Merge (85.2%).
  • It is more common in projects set up for Roo Code (19.8%) than for OpenCode (6.4%).

By coding agent

312 projects, 9.5%
304 projects, 12.4%
267 projects, 8.8%
52 projects, 18.6%
47 projects, 9.9%
41 projects, 8.7%
22 projects, 19.8%
22 projects, 6.4%

Often used with

In 92.7% of its projects
In 86.3% of its projects
In 85.2% of its projects
In 79.7% of its projects
In 99.0% of its projects
In 96.5% of its projects
In 71.7% of its projects
In 68.6% of its projects

Recharts in practice

Strengths

Axis, tooltip, grid and lines are separate components

The README says a <code>LineChart</code> is composed of an x axis, a tooltip, a grid and line items. Each one is an independent React component. The maintainers call this separation one of the library's principles.

SVG output worked inside React-pdf

One developer picked Recharts for client PDF reports because of its SVG output and component design. It connected to React-pdf through the <code>react-pdf-charts</code> wrapper.

Positive and negative bars stack with two props

For a chart with positive and negative values, the same developer set <code>stackId</code> on each <code>Bar</code> and <code>stackOffset='sign'</code> on the <code>BarChart</code>. He writes that Recharts then places each bar on the correct side of the Y axis and stacks them.

npm, Deno or a script tag

The README gives three install routes: <code>npm install recharts react-is</code>, <code>deno add recharts react-is</code>, or UMD scripts from unpkg that expose <code>window.Recharts</code>.

Watch out for

No built-in chart title

Recharts has no title component. The author notes that many users find this frustrating, and suggests Flex or similar layout to center a title over the graph.

Labels can push the chart past its margins

The author increased the chart's margins so everything fit inside the container. He says Recharts "seems to" have trouble with margin calculations once labels are involved.

Making charts look good takes extra work

In the author's view, building graphs in Recharts is easy but making them beautiful is harder. His post walks step by step through building one real graph component.

A line chart with two series

<LineChart width={400} height={400} data={data}>
  <XAxis dataKey="name" />
  <Tooltip />
  <CartesianGrid stroke="#f5f5f5" />
  <Line type="monotone" dataKey="uv" stroke="#ff7300" />
  <Line type="monotone" dataKey="pv" stroke="#387908" />
</LineChart>

More about Recharts

Funding
  • Open Collective: https://opencollective.com/recharts

See all

Head to head
Packages around it
  • lucide-react: Icon components
  • clsx: Conditional class names
  • tailwind-merge: Tailwind class merging
  • class-variance-authority: Variant class names
  • @radix-ui: UI primitives
  • zod: Schema validation
More in Charts and data visualisation

Alternatives

Recharts This page

MITGid 8571.4M/wk

Chart.js

Simple HTML5 canvas-based charting library for creating interactive data visualizations.

MITGid 7818M/wk

D3.js

JavaScript library for creating data-driven documents with powerful data visualization capabilities.

ISCGid 8136M/wk

Apache ECharts

Powerful interactive charting library for data visualization in browsers.

Apache-2.0Gid 7511.4M/wk

ApexCharts

Interactive JavaScript charting library for creating modern data visualizations.

SEE LICENSE IN LICENSE.mdGid 602.9M/wk

React ApexCharts

React wrapper for ApexCharts with server-side rendering support.

SEE LICENSE IN LICENSE.mdGid 481.5M/wk

Compare Recharts with another tool

Get started

Install it.

npm install recharts

Rules for your agent

Paste into AGENTS.md or CLAUDE.md
## Recharts
- Install with `npm install recharts react-is` (or `deno add recharts react-is`), and keep `react-is` at the same version as the project's `react`.
- Build charts by nesting components such as `XAxis`, `YAxis`, `Tooltip`, `CartesianGrid`, `Legend` and `Line`/`Bar` inside a chart component like `LineChart` or `BarChart`.
- Set `dataKey` on axes and series to a field name present in the objects of the `data` array.
- For a chart that sizes to its container, follow the site example: pass `responsive` and a `style` with `width: '100%'` and an `aspectRatio`.
- For bars with positive and negative values, give each `Bar` the same `stackId` and set `stackOffset='sign'` on the chart.
- There is no title component: render titles as ordinary elements outside the chart. If axis labels run outside the container, increase the chart's `margin` prop.
- For a script-tag setup, load react, react-dom and react-is UMD builds before `Recharts.js`, then use `window.Recharts`.