Stacked Radial Area
Three radial layers are drawn as stacked areas in polar coordinates, each representing a categorical series (a, b, c) across seven time steps. The chart reads as a circular time series with a Sunday axis at top. It uses d3.layout.stack, d3.svg.area.radial, and a cardinal-closed interpolator; the axes are drawn with d3.svg.axis. Data comes from a CSV loaded with d3.csv. The code also outlines limitations, such as the continuity across the Sunday boundary and non-radial interpolation.
AI-generated descriptionThis plot might be suitable for showing cyclical trends, though I'm not sure it’s a great idea as the radial display has a number of limitations:
The underlying data goes from Sunday to Saturday, but the chart shows continuity from Saturday through to the previous Sunday. Time does not flow backwards, so you might instead prefer to plot two values for Sunday; this would show a discontinuity on opposite sides of the Sunday axis.
Displaying the discontinuity requires an open interpolator, rather than cardinal-closed as used here. However, this causes the tangents of the incoming and outgoing lines to no longer be orthogonal to the axis. To display the discontinuity properly, you’d need to write a custom interpolator to generate the correct tangents.
Due to the interpolation taking place in Cartesian (rather than polar) coordinates, the intermediate values of the lines do not have the correct radial values: if you tried to measure the intermediate values using the radius, they would be wrong. The only way to fix this is to interpolate in polar coordinates, which requires plotting the intermediate values as Archimedian spirals. There is no native representation for spirals in SVG, so you must resample the spirals as piecewise Bézier curves. Needless to say, this is a fair amount of work, but it might be something D3 supports in the future.
Polar charts are pretty. But when in doubt, it’s probably best to stick to Cartesian coordinates.