React components for Chart.js
npm install react-chartjs-2React components for Chart.js, the most popular charting library.
Supports Chart.js v4 and v3.
[![NPM version][npm]][npm-url]
[![Downloads][downloads]][downloads-url]
[![Build status][build]][build-url]
[![Coverage status][coverage]][coverage-url]
[![Bundle size][size]][size-url]
[npm]: https://img.shields.io/npm/v/react-chartjs-2.svg
[npm-url]: https://www.npmjs.com/package/react-chartjs-2
[downloads]: https://img.shields.io/npm/dm/react-chartjs-2.svg
[downloads-url]: https://www.npmjs.com/package/react-chartjs-2
[build]: https://img.shields.io/github/actions/workflow/status/reactchartjs/react-chartjs-2/ci.yml?branch=master
[build-url]: https://github.com/reactchartjs/react-chartjs-2/actions
[coverage]: https://img.shields.io/codecov/c/github/reactchartjs/react-chartjs-2.svg
[coverage-url]: https://app.codecov.io/gh/reactchartjs/react-chartjs-2
[size]: https://img.shields.io/bundlephobia/minzip/react-chartjs-2
[size-url]: https://bundlephobia.com/package/react-chartjs-2
Quickstart
•
Docs
•
Stack Overflow
Install this library with peer dependencies:
``bash`
pnpm add react-chartjs-2 chart.jsor
yarn add react-chartjs-2 chart.jsor
npm i react-chartjs-2 chart.js
We recommend using chart.js@^4.0.0.
Then, import and use individual components:
`jsx
import { Doughnut } from 'react-chartjs-2';
``
- Migration to v4
- Working with datasets
- Working with events
- FAQ
- Components
- Examples
MIT Licensed
Copyright (c) 2020 Jeremy Ayerst