Melting Data for multiple lines | interractive Legend
✓ Published1🌍 Public
Vvladvaculin
Last edited Sep 10, 2019
Created on Sep 10, 2019
Forked from Line Chart multiple lines | interractive Legend
This example visualizes population trends for multiple countries from 1950 to 2100 as a multi-line chart, with an interactive legend allowing users to highlight a single country by clicking its legend entry or line path. The chart uses d3.nest to group data, d3.scaleTime and d3.scaleLinear for axes, and d3.line with curveBasis for smooth paths. Rendered as SVG, the color legend is built with custom reusable code that updates stroke opacity on selection. Data comes from UN population estimates fetched via d3.dsv.
AI-generated descriptionClick on Legend or paths to isolate the data!
MIT Licensed