Small Multiples II
✓ Published0🌍 Public
Mmbostock
Last edited May 27, 2016
Created on Mar 11, 2014
Small multiples display time-series price data for the S&P 500 and MSFT from a TSV file, each chart drawing a gray line and light-gray area chart with its own independent y-axis scale. The D3 v4 code creates a scope per symbol using `selection.each` and the `multiple` function, applying a linear scale for price and a time scale for dates. Each SVG contains an area path and a line path appended via `d3.area` and `d3.line`, with the data nested by symbol using `d3.nest`.
AI-generated descriptionA variant of the small multiples example which, instead of resetting the domain of the y-axis every time it is used, creates a scope for each small multiple using selection.each.
gpl-3.0 Licensed