Show project name and percentage on same line in pie chart
All checks were successful
Build and Push Docker Images / docker (push) Successful in 58s
All checks were successful
Build and Push Docker Images / docker (push) Successful in 58s
- Combine project name and percentage into single label line - Format: "Project Name (25.0%)" - Reduces vertical space and improves readability - Cleaner, more compact label design 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
3273d4af2a
commit
f0337101cf
@ -82,24 +82,15 @@ export function RechartsPortfolioPieChart({
|
|||||||
className="print:stroke-gray-400"
|
className="print:stroke-gray-400"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Two-line label text - project name and percentage only */}
|
{/* Single-line label text - project name with percentage */}
|
||||||
<text
|
<text
|
||||||
x={lineEndX}
|
x={lineEndX}
|
||||||
y={y - 6}
|
y={y}
|
||||||
textAnchor={textAnchor}
|
textAnchor={textAnchor}
|
||||||
className="fill-slate-700 print:text-[7px]"
|
className="fill-slate-700 print:text-[7px]"
|
||||||
style={{ fontSize: '10px', fontWeight: 600 }}
|
style={{ fontSize: '10px', fontWeight: 600 }}
|
||||||
>
|
>
|
||||||
{name}
|
{name} ({percentage.toFixed(1)}%)
|
||||||
</text>
|
|
||||||
<text
|
|
||||||
x={lineEndX}
|
|
||||||
y={y + 8}
|
|
||||||
textAnchor={textAnchor}
|
|
||||||
className="fill-slate-800 print:text-[6px]"
|
|
||||||
style={{ fontSize: '9px', fontWeight: 700 }}
|
|
||||||
>
|
|
||||||
{percentage.toFixed(1)}%
|
|
||||||
</text>
|
</text>
|
||||||
</g>
|
</g>
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user