Moved pie chart labels to the outside of the pie

main
Antonio De Lucreziis 2 years ago
parent 484d5b84f8
commit 77043f731f

@ -73,9 +73,9 @@ export const PieChart = ({ parts, labels, total, totalLabel }) => {
g.fillText( g.fillText(
label, label,
Math.cos(acc + angle / 2 - 0.5 * Math.PI) * 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) * 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 acc += angle

Loading…
Cancel
Save