🌍 Public
Viewing a saved revision (read-only)
26fddc51bc5f4420a1390ed88246c996
Activity6_Q1
This example visualizes the top 10 most populous countries from 2016 to 2020 using a stacked horizontal bar chart, where each bar is segmented by year to show the population distribution across the five-year period. The chart is built with D3.js v7, using `d3.stack()` to create the stacked data, `d3.scaleBand` for the y-axis, and `d3.scaleLinear` for the x-axis. Hovering over a segment displays a tooltip with the specific year, population, and percentage share. The data is sourced from a CSV file containing population figures for each country and year.
AI-generated description