Skip to main content
100%

Fork of Selecting a Year on a Line Chart

✓ Published0🌍 Public
AAmmar Ehab
Last edited Aug 16, 2022
Created on Aug 16, 2022

This interactive line chart displays population trends over time by region, with a movable vertical line that updates the selected year on hover. The visualization uses d3.scaleTime, d3.scaleLinear, d3.nest, and d3.line with curveBasis to render smooth paths from UN population estimates and medium-variant projections (1950–2100). A d3.ordinal color scale distinguishes regions via a legend, while mouse events trigger year selection through d3.mouse and axis inversion. SVG rendering handles all elements, including gridlines, labeled axes, and an interactive overlay rect.

AI-generated description
MIT Licensed

Similar vizzes