Skip to main content
100%

Selecting a Year on a Line Chart

✓ Published0🌍 Public
Ggabcoderboi
Last edited Jan 5, 2021
Created on Jan 3, 2021

This line chart visualizes projected global population by region from 1950 to 2100, using UN population estimates and medium-variant projections. A vertical black line marks a selected year, and moving the mouse across the chart updates the selection, re-rendering the visualization. The code uses d3.scaleTime, d3.scaleLinear, d3.line with curveBasis, and d3.nest for grouping, with SVG rendering and a color legend. Data is loaded via d3.csv from two datasets and processed through a custom melt function.

AI-generated description
MIT Licensed

Similar vizzes