Fakultas Ilmu Komputer UI

Commit e1438349 authored by Zafir Rasyidi Taufik's avatar Zafir Rasyidi Taufik
Browse files

[REFACTOR]Remove unused functions and fix chart location slightly

parent 6466306c
Pipeline #63899 failed with stages
in 4 minutes and 53 seconds
......@@ -31,14 +31,11 @@ function Statistic({
minAge: 0,
maxAge: 0,
});
const [activeIndex, setActiveIndex] = useState<number[]>([]);
const [activeIndex, setActiveIndex] = useState<number[]>([0,1,2]);
const [
selectedKeyData,
setselectedKeyData
] = useState<any[]>([{}]);
// const onPieEnter = (_pData: any, index: number) => {
// setActiveIndex(index);
// };
const filterExports = async (filterType: StatisticType) => {
const response = await services.main.filterExportCSV(
......@@ -129,25 +126,15 @@ function Statistic({
setPagedData(tableData.slice(0, 10));
}, [tableData]);
const getActiveIndices = () => {
let res: Array<number> = []
for (let index = 0; index < 3; index++) {
if(selectedKeyData[index].jumlah > 0) {
res.push(index);
}
}
return res;
};
const renderChart = () => {
if (chartType) {
return (
<PieChart width={425} height={265}>
<Pie
activeIndex={[0,1,2]}
activeIndex={activeIndex}
activeShape={renderActiveShape}
data={selectedKeyData}
cx={200}
cx={210}
cy={120}
innerRadius={60}
outerRadius={80}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment