Activity6_Q2
✓ Published0🌍 Public
This example shows the top 20 countries by population in 2010 as a horizontal bar chart, using a lightgreen fill for each bar. The chart is rendered with D3 v7 in an SVG container, with a linear x-scale for population values and a band y-scale for country names. Data is loaded from a CSV file via `d3.csv` and sorted in descending order before being sliced to the top 20. The axes are customized with formatted tick labels (using `d3.format` to abbreviate billions) and axis title text, and the chart redraws responsively on window resize.
AI-generated descriptionMIT Licensed