Skip to main content
100%

Selecting a Year on a Line Chart

✓ Published1🌍 Public
Vvic126
Last edited Jul 3, 2020
Created on Jul 2, 2020

This visualization shows population trends over time for major world regions, with a vertical green line marking a selected year that users can change by moving the mouse across the chart. The line chart uses d3.line with a curveBasis for smoothing, while d3.nest groups the data by region. A d3.mouse handler on a transparent rectangle calls xScale.invert to convert mouse position into a year, updating the selection. Data comes from UN population estimates loaded via d3.csv.

AI-generated description
MIT Licensed

Similar vizzes