import { Pie, PieChart, ResponsiveContainer, Tooltip } from 'recharts'; function PieCharts( props ) { let { chartLabel, color1, cx, cy, dataset, height, innerRadius, key1, name1, outerRadius, percentage, } = props; if ( outerRadius ) height = outerRadius * 2.8; if ( !color1 ) color1 = "#8884d8"; if ( !cx ) cx = '50%'; if ( !cy ) cy = '50%'; if ( !height ) height = 400; // Calculate the total value for percentage calculation const totalValue = dataset.reduce((sum, item) => sum + item[key1], 0); return (