Skip to main content
100%

Selecting a Year on a Line Chart

✓ Published0🌍 Public
Eedxiao97
Last edited Sep 30, 2019
Created on Sep 30, 2019

This example shows population trends over time by region, with a vertical line marking the currently selected year. Moving the mouse along the chart updates the selection and redraws the visualization. The multi-line chart uses d3.line with curveBasis, while d3.nest groups data by region and d3.scaleOrdinal assigns colors. A legend, built with custom SVG code, displays color mappings. The data comes from UN population estimates processed in loadAndProcessData.js, combining medium variant projections for 2015-2100 with historical estimates.

AI-generated description
MIT Licensed

Similar vizzes