Home

Awesome

react-chartjs-2

<img align="right" width="150" height="150" alt="Logo" src="website/static/img/logo.svg">

React components for <a href="https://www.chartjs.org">Chart.js</a>, the most popular charting library.

Supports Chart.js v4 and v3.

NPM version Downloads Build status Coverage status Bundle size

<br /> <a href="#quickstart">Quickstart</a> <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span> <a href="#docs">Docs</a> <span>&nbsp;&nbsp;•&nbsp;&nbsp;</span> <a href="https://stackoverflow.com/questions/tagged/react-chartjs-2">Stack Overflow</a> <br /> <hr />

Quickstart

Install this library with peer dependencies:

pnpm add react-chartjs-2 chart.js
# or
yarn add react-chartjs-2 chart.js
# or
npm i react-chartjs-2 chart.js

We recommend using chart.js@^4.0.0.

Then, import and use individual components:

import { Doughnut } from 'react-chartjs-2';

<Doughnut data={...} />

Need an API to fetch data? Consider Cube, an open-source API for data apps.

<br />

supported by Cube

Docs

License

MIT Licensed Copyright (c) 2020 Jeremy Ayerst