react-chartjs-2
React components for Chart.js, the most popular charting library.
Supports Chart.js v4 (read below) and Chart.js v3 (see this guide).
Quickstart
Section titled “Quickstart”Install this library with peer dependencies:
pnpm add chart.js react-chartjs-2yarn add chart.js react-chartjs-2npm install --save chart.js react-chartjs-2Then, import and use individual components:
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from "chart.js";import { Doughnut } from "react-chartjs-2";
ChartJS.register(ArcElement, Tooltip, Legend);
<Doughnut data={...} />To learn more about importing and registering elements see tree-shaking.
Examples
Section titled “Examples”Please see live examples.
Getting Help
Section titled “Getting Help”Need help? Check the FAQ or ask a question in GitHub Discussions.
If you've encountered an issue, please file it on GitHub.