|
|
|
@ -7,7 +7,7 @@ import styles from "./PieChart.module.css"; |
|
|
|
|
interface PieChartProps { |
|
|
|
|
data: PieChartData[]; |
|
|
|
|
width: number; |
|
|
|
|
textPadding: number; |
|
|
|
|
labelWidth: number; |
|
|
|
|
className?: string; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -16,8 +16,8 @@ interface PieChartData { |
|
|
|
|
value: number; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export function PieChart({ width, textPadding, ...props }: PieChartProps) { |
|
|
|
|
const pieWidth = width * 0.5 - textPadding; |
|
|
|
|
export function PieChart({ width, labelWidth, ...props }: PieChartProps) { |
|
|
|
|
const pieWidth = width * 0.5 - labelWidth; |
|
|
|
|
return ( |
|
|
|
|
<svg className={props.className} width={width} height={width}> |
|
|
|
|
<Group top={width * 0.5} left={width * 0.5}> |
|
|
|
|