diff --git a/_frontend/src/components/charts/PieChart.jsx b/_frontend/src/components/charts/PieChart.jsx index 6a1030c..d1efd9e 100644 --- a/_frontend/src/components/charts/PieChart.jsx +++ b/_frontend/src/components/charts/PieChart.jsx @@ -66,16 +66,11 @@ export const PieChart = ({ parts, labels, total, totalLabel }) => { g.lineTo(0, 0) g.stroke() - const { width: w } = g.measureText(label) - const textRadius = Math.sqrt(w ** 2 + 16 ** 2) / 2 - g.fillStyle = `hsl(${((hashCode(`${i} ${seed}`) % 0xff) * 360) / 0xff}, 80%, 15%)` g.fillText( label, - Math.cos(acc + angle / 2 - 0.5 * Math.PI) * - (width * 0.5 * 0.85 + textRadius * 0.8), - Math.sin(acc + angle / 2 - 0.5 * Math.PI) * - (width * 0.5 * 0.85 + textRadius * 0.8) + Math.cos(acc + angle / 2 - 0.5 * Math.PI) * (width * 0.5 * 0.9125), + Math.sin(acc + angle / 2 - 0.5 * Math.PI) * (width * 0.5 * 0.9125) ) acc += angle