diff --git a/src/components/RechartsPortfolioPieChart.tsx b/src/components/RechartsPortfolioPieChart.tsx index ed1f223..f89bf6a 100644 --- a/src/components/RechartsPortfolioPieChart.tsx +++ b/src/components/RechartsPortfolioPieChart.tsx @@ -50,13 +50,13 @@ export function RechartsPortfolioPieChart({ } = props; const RADIAN = Math.PI / 180; - const radius = outerRadius + 60; + const radius = outerRadius + 35; const x = cx + radius * Math.cos(-midAngle * RADIAN); const y = cy + radius * Math.sin(-midAngle * RADIAN); const textAnchor = x > cx ? 'start' : 'end'; // Calculate line endpoint for label connector - const lineEndX = x > cx ? x + 50 : x - 50; + const lineEndX = x > cx ? x + 30 : x - 30; const labelStartX = cx + (outerRadius + 10) * Math.cos(-midAngle * RADIAN); const labelStartY = cy + (outerRadius + 10) * Math.sin(-midAngle * RADIAN); @@ -69,7 +69,7 @@ export function RechartsPortfolioPieChart({ x2={x} y2={y} stroke={fill} - strokeWidth="2" + strokeWidth="1.5" className="print:stroke-gray-400" /> - {/* Three-line label text */} + {/* Three-line label text - smaller sizes */} {name} {tons} tons {percentage.toFixed(1)}% @@ -115,42 +115,44 @@ export function RechartsPortfolioPieChart({ }; return ( -
- {/* SVG Chart */} - - - - {chartData.map((entry, index) => ( - - ))} - {/* Center label showing total */} - - - +
+ {/* SVG Chart - Responsive container */} +
+ + + + {chartData.map((entry, index) => ( + + ))} + {/* Center label showing total */} + + + +
{/* Legend below chart (for print clarity) */}