From 77043f731ff519b29db058a2fdea056e857e6750 Mon Sep 17 00:00:00 2001 From: Antonio De Lucreziis Date: Fri, 8 Jul 2022 18:17:55 +0200 Subject: [PATCH] Moved pie chart labels to the outside of the pie --- _frontend/src/components/charts/PieChart.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_frontend/src/components/charts/PieChart.jsx b/_frontend/src/components/charts/PieChart.jsx index 42c6221..6a1030c 100644 --- a/_frontend/src/components/charts/PieChart.jsx +++ b/_frontend/src/components/charts/PieChart.jsx @@ -73,9 +73,9 @@ export const PieChart = ({ parts, labels, total, totalLabel }) => { g.fillText( label, Math.cos(acc + angle / 2 - 0.5 * Math.PI) * - (width * 0.5 * 0.7 - textRadius * 0.8), + (width * 0.5 * 0.85 + textRadius * 0.8), Math.sin(acc + angle / 2 - 0.5 * Math.PI) * - (width * 0.5 * 0.7 - textRadius * 0.8) + (width * 0.5 * 0.85 + textRadius * 0.8) ) acc += angle