Selecting a Year on a Line Chart
✓ Published0🌍 Public
Multiple colored lines trace regional population changes from 1950 to 2100, using data from the UN Population Estimates and Medium Variant datasets. A vertical black line marks the currently selected year, which updates when the user hovers over the chart via a mouse-interceptor rectangle that calls `setSelectedYear` with `xScale.invert`. The chart uses d3.scaleTime, d3.scaleLinear, d3.line with curveBasis, and d3.axisLeft/axisBottom; a separate color legend built with `colorLegend.js` identifies each region.
AI-generated descriptionMIT Licensed