All files / src/app/teacher-page/page/dashboard/components PassFailPieChart.jsx

100% Statements 3/3
100% Branches 0/0
100% Functions 1/1
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17        2x 2x                 2x    
import { useTheme } from "@mui/material/styles";
import ReactApexChart from "react-apexcharts";
 
export default function PassFailPieChart({ passed, failed }) {
    const theme = useTheme();
    const options = {
        colors: ["#006400", "#cc0000"],
        labels: ["Passed", "Failed"],
        dataLabels: { enabled: true, style: { colors: ["#fff"], fontSize: "13px" } },
        legend: { position: "bottom", labels: { colors: theme.palette.text.primary } },
        tooltip: { theme: theme.palette.mode },
        stroke: { width: 2 },
        plotOptions: { pie: { expandOnClick: false } },
    };
    return <ReactApexChart options={options} series={[passed, failed]} type="pie" width="100%" height={260} />;
}