🌍 Public
[A7] (Small Multiples of Lines Chart with a Color Legend)
This example uses small multiples to display the Consumer Price Index (CPI) of four grains—Corn, Rice, Rye, and Wheat—from 2000 to 2015, with each grain in its own line chart. A color legend identifies each grain’s stroke color. The code loads CSV data via `d3.csv`, renders SVG line charts using `d3.line` and `d3.axisBottom`, and builds the legend with `d3.legendColor` from the d3-legend library.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.
MIT Licensed
![[A7] CPI of Various Grains from 2000 - 2015 (Multi-Line Chart with a Color Legend)](/viz/5397762c89a7414682bb3ce931f0453c/social-image.png?v=0b6b2775c40b4397b4b97927f0f105ab)
![[A7] (Heat Map for Time Series Data with a Color Legend)](/viz/fe4800804b6a4bb0ba108e4997d78874/social-image.png?v=6ffdf70aabc44585a03e00d22a1d4a77)
![[A11] My Chart](/viz/b442f2340cd543c88d88463c95f2f1d4/social-image.png?v=461d19cf32b14f6c98c3e43b490536b3)





Comments
Sign in to join the discussion.