From 393a17a26acdf731e07ed92e990af7fba4e76b46 Mon Sep 17 00:00:00 2001 From: Xavier Fernandes Date: Tue, 25 May 2021 13:44:48 -0700 Subject: [PATCH] Enlarge the spider chart and align the labels --- .../PerspectiveScoresSpiderChart.tsx | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/frontend/components/PerspectiveScoresSpiderChart.tsx b/frontend/components/PerspectiveScoresSpiderChart.tsx index e90af39..6cb7987 100644 --- a/frontend/components/PerspectiveScoresSpiderChart.tsx +++ b/frontend/components/PerspectiveScoresSpiderChart.tsx @@ -42,27 +42,29 @@ class PerspectiveScoresSpiderChart extends Component svg.append("circle") - .attr("cx", 200) - .attr("cy", 155) + .attr("cx", centerX) + .attr("cy", centerY) .attr("fill", "none") .attr("stroke", "rgba(224, 224, 224, 1)") .attr("stroke-width", "1px") @@ -72,7 +74,7 @@ class PerspectiveScoresSpiderChart extends Component { let x = Math.cos(angle) * radialScale(value); let y = Math.sin(angle) * radialScale(value); - return {"x": 200 + x, "y": 155 - y}; + return {"x": centerX + x, "y": centerY - y}; } const getLabelOffset = (index: number, label: string) => { @@ -80,8 +82,12 @@ class PerspectiveScoresSpiderChart extends Component