Skip to main content
100%

Selecting a Year on a Line Chart

✓ Published2🌍 Public
AArriannePandaraoan
Last edited May 9, 2020
Created on May 4, 2020

This visualization shows United Nations population projections from 1950 to 2100 as a multi-line chart, with each line representing a regional grouping such as "More developed regions" or "Less developed regions." A vertical black line marks the currently selected year, and moving the mouse across the chart updates this selection, allowing users to compare population values across regions at a specific point in time. The chart is built with D3 v5, using `scaleTime`, `scaleLinear`, `axisBottom`, `axisLeft`, and a `line` generator with `curveBasis` for smooth paths. A `colorLegend` module renders the categorical color scale, while data is loaded from two CSV files using `csv` and processed via a `melt` function that reshapes the wide format into tidy long-form rows.

AI-generated description
MIT Licensed

Similar vizzes