Smoothed D3.js Radar Chart
This smoothed radar chart visualizes survey responses on smartphone preferences, comparing devices like iPhone, Samsung, and Nokia Smartphone across eight reasons such as Battery Life and Brand. Each device is represented by a colored, smoothed polygon overlaid on a circular grid with five value levels. The chart is rendered with SVG and includes an interactive legend, built with d3-legend, which highlights corresponding radar areas on hover. The legend position is configurable, and the underlying implementation assigns data-driven class names to each area for seamless interaction. The visualization is animated and uses smoothed curves to make the data easier to compare across multiple dimensions.
AI-generated descriptionthis version adds a legend!
to enable the legend symbol to interact with the areas, when you call RadarChart(), specify the field radarChart.js should use to assign an areaName to each area.
you can also specify the legend position as a parameter, where x and y are pixel coordinates offset from an origin at the top left of the parent svg.
var legendPosition = {x: 25, y: 25}
var radarChartOptions {
areaName: "device",
legendPosition: legendPosition
// ...
};
to get the interaction to work, we add a data-driven class to each area that we can later select in the cellover() function that is called when you mouse over the legend symbol.
blobWrapper
.append("path")
.attr("class", function(d) {
return "radarArea" + " " + d[0][areaName].replace(/\s+/g, '') //Remove spaces from the areaName string to make one valid class name
})
// ...
the legend is created with the delightful d3-legend component from susielu
an iteration on the bl.ock radar chart with smallest area on top by micahstubbs
a further iteration on the bl.ock Radar Chart Redesign created by nbremer, which is described nicely in this blog post
forked from <a href='http://bl.ocks.org/micahstubbs/'>micahstubbs</a>'s block: <a href='http://bl.ocks.org/micahstubbs/a772306d6fd49874ec92'>radar chart with an interactive legend</a>