Selecting a year on line chart
✓ Published0🌍 Public
AAjit Singh
Last edited Jan 17, 2021
Created on Jan 17, 2021
Forked from Melting Data for multiple lines - new un Data
This line chart displays world population estimates by region from 1950 to 2100, using data from the UN Population Estimates and Medium Variant datasets. A vertical line marks the currently selected year, which updates as the user moves the mouse across the chart. The visualization is built with D3 v5, using `d3.nest` to group data by region, `d3.line` with `curveBasis` for smooth paths, and `d3.axisBottom` and `d3.axisLeft` for axes. Hovering triggers `d3.mouse` and `xScale.invert` to detect the year, then re-renders the selection line.
AI-generated descriptionAn example including some commonly used features of SVG.
MIT Licensed