Quickstart: Use react-chartjs-2 components
masterTo use a component, you must first import the necessary elements from chart.js and register them using ChartJS.register(). Then, import the specific chart component from react-chartjs-2 and pass the required data prop.
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from "chart.js";
import { Doughnut } from "react-chartjs-2";
ChartJS.register(ArcElement, Tooltip, Legend);
<Doughnut data={...} />