Moved pie chart labels to the outside of the pie
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user