Stacked-to-Multiples (improved)
This interactive visualization compares quarterly data across four groups, toggling between small-multiples and stacked layouts. Each group’s time series bars show raw values, with white text labels inside each bar indicating the group’s contribution per quarter, while the code accumulates these contributions into an array to reveal quarter totals. Using d3.v3, the example employs d3.layout.stack, ordinal and linear scales, d3.svg.axis, and transition.attrTween for smooth animated shifts between views. Data loads from a TSV file with date and value fields, rendered as SVG rectangles and text.
AI-generated descriptionThis is largely based on Mike Bostock's Stacked-to-Multiples gist. I have added 4 snippets to the original code in order to represent the magnitudes of each group per quarter and also each quarter's total. I find totalling the values as they are stacked to be an efficient and intuitive way to marry visual movement with enhanced information display.
forked from <a href='http://bl.ocks.org/fernoftheandes/'>fernoftheandes</a>'s block: <a href='http://bl.ocks.org/fernoftheandes/93c5c349be14f459c98a'>Stacked-to-Multiples (improved)</a>