import React, { useState } from "react"; import { Doughnut } from "react-chartjs-2"; import { Chart, ArcElement } from "chart.js"; import { MenuItem, Select, FormControl } from "@mui/material"; import styles from "./ParticipationChart.module.css"; Chart.register(ArcElement); function participationChart() { const [selected, setSelected] = useState("3"); const [participationRate, setParticipationRate] = useState(89); const chartData = { labels: ["Progress", "Background"], datasets: [ { data: [participationRate, 100 - participationRate], backgroundColor: ["#1e60f9ff", "#ffffffff"], borderWidth: 0, weight: 10, cutout: "93%", circumference: 360, rotation: -90, }, ], }; const chartOptions = { responsive: true, plugins: { legend: { display: false }, tooltip: { enabled: false }, }, animation: { animateScale: true, animateRotate: true, }, }; return (
{participationRate}%
); } export default participationChart;