Skip to main content
100%

Selecting a Year on a Line Chart

✓ Published0🌍 Public
MMatthew Rubino
Last edited Jun 19, 2021
Created on Jun 19, 2021

This visualization displays global population trends over time as a multi-line chart, with each line representing a different country and colored via `d3.scaleOrdinal`. Users hover over the chart to select a year, which triggers a vertical line and updates the visualization through a `mousemove` event using `d3.pointer` and `xScale.invert`. The chart renders with SVG, uses `d3.scaleTime` and `d3.scaleLinear` for axes, and generates paths with `d3.line` and `d3.curveBasis`. Data comes from UN population estimates processed through `d3.csv` and `topojson`.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes