Skip to main content
Public

Share visualization

Loading preview…

Selecting a Year on a line chart

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Selecting a Year on a line chart

0
NNeepaB
Last edited Jan 7, 2021
Created on Jan 7, 2021

This interactive line chart displays population changes over time for multiple world regions, using a vertical black line to mark a user-selected year. Moving the mouse across the chart updates the selected year, which is reflected in the line’s position. The visualization is built with D3 v5, using `d3.line` for the paths, `d3.axisBottom` and `d3.axisLeft` for axes, and a `mousemove` event listener on a transparent overlay rect to trigger year changes. Data comes from UN population estimates and medium variant projections, rendered as SVG.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed