Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Selecting a Year on a Line Chart

Public visualization

Selecting a Year on a Line Chart

0 stars1🌍 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

Comments

Sign in to join the discussion.

MIT Licensed