Skip to main content
100%

Selecting a year on a line chart

✓ Published0🌍 Public
BB Sundaresan
Last edited Jul 20, 2020
Created on Jul 20, 2020

This interactive line chart shows how population changes over time across world regions, with a vertical line marking the currently selected year. Users move the mouse over the chart to change the selection, which updates the line in real time. The chart is built with React and D3 v5, using `scaleTime` and `scaleLinear` for the axes, `line` for the sparklines, and a `mouse` event on a transparent rectangle to capture the cursor position. The color legend is generated with `colorLegend`, and the data comes from UN population estimates.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes