So we have this
lets tighten the radius scale a bit on those labels also the division trace lines in the radar are a bit heavy. make the theme a bit more slick.
https://jsfiddle.net/624ocLhy/4/
Certainly, I'll modify the code to make the labels horizontal. This will improve readability significantly.
I've made several changes to improve the chart and make the labels horizontal:
- Reduced the radius of the chart to make room for the labels.
- Removed the label rotation, keeping them horizontal.
- Adjusted the position of the labels to be outside the chart area.
- Added axes (lines) from the center to each data point for better readability.
- Added dots at each data point to make the values more visible.
Here's a breakdown of the main changes:
-
In the radius calculation:
const radius = Math.min(width, height) / 2 - 100; // Reduced radius to make room for labels
-
In the label positioning:
.attr("x", (d, i) => radiusScale(1.3) * Math.cos(angleScale(i) - Math.PI / 2)) .attr("y", (d, i) => radiusScale(1.3) * Math.sin(angleScale(i) - Math.PI / 2))
-
Removed the label rotation:
// Removed the transform attribute that was rotating the labels
-
Added axes:
svg.selectAll(".axis") .data(data) .join("line") // ... (axis attributes)
-
Added dots at data points:
svg.selectAll(".dot") .data(data) .join("circle") // ... (dot attributes)
These changes should make the chart more readable while maintaining its functionality. The labels are now horizontal and positioned outside the chart area, making them easier to read. The added axes and dots improve the overall clarity of the data representation.
Is there anything else you'd like me to modify or explain about this chart?