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 stars0🌍 Public
HHe Jianfeng
Last edited Apr 16, 2021
Created on Apr 16, 2021

This visualization shows population trends over time for world regions, with a vertical black line marking the currently selected year. Moving the mouse across the chart updates the selected year and repositions the line. The code uses D3 v6 with SVG rendering, employing `scaleTime`, `scaleLinear`, `line` with `curveBasis`, and `axisBottom`/`axisLeft` for axes. Data comes from UN population estimates CSV files, melted into tidy format for visualization. The color legend is built with a custom `colorLegend` function using `scaleOrdinal` and `schemeCategory10`.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed