import { Pagination, Progress, PaginationItem, PaginationLink, Button } from "reactstrap"; import Sparkline from "@/components/Common/Sparklines"; import { Container, Row, Col, Card, CardHeader, CardBody } from "reactstrap"; import FlotChart from "@/components/Charts/Flot.js"; import { ChartSpline, ChartArea, ChartBar, ChartBarStacked, ChartDonut, ChartLine, ChartPie } from "@/components/Config/flot.setup.js"; import Datatable from "@/components/Tables/Datatable"; import { useState, useEffect } from "react"; function CaseProgress({ data }) { const laporan_pertahun = data.laporan_perTahun; const laporan_terbaru = data.newLaporan; const [chartData, setChartData] = useState([ { // "label": "sales", color: "#287DAD", data: [], }, ]); useEffect(() => { laporan_pertahun.forEach((e) => { chartData[0].data.push([convertMonth(e._id.bulan), e.jumlah_laporan]); }); }, []); const convertMonth = (int) => { switch (int) { case 1: return "Januari"; break; case 2: return "Februari"; break; case 3: return "Maret"; break; case 4: return "April"; break; case 5: return "Mei"; break; case 6: return "Juni"; break; case 7: return "Juli"; break; case 8: return "Agustus"; break; case 9: return "September"; break; case 10: return "Oktober"; break; case 11: return "November"; break; case 12: return "Desember"; break; default: break; } }; const ChartPie = { data: [ { label: "Pelaporan masuk", color: "#287DAD", data: 40, }, { label: "Pelaporan selesai", color: "#52D489", data: 70, }, ], options: { series: { pie: { show: true, innerRadius: 0, label: { show: true, radius: 0.8, formatter: function (label, series) { return ( '
' + //label + ' : ' + Math.round(series.percent) + "%
" ); }, background: { opacity: 0.8, color: "#222", }, }, }, }, }, }; return (
Tahun 2022

Perkembangan

Rekapitulasi

Laporan Terbaru

{laporan_terbaru.map((value) => (
{`${value.no_laporan} - ${value.pt.nama}`}
))}
); } export default CaseProgress;