🌍 Public
Test svg
This bar chart displays the population of the ten most populous countries, with horizontal bars sorted by country name. The visualization uses D3 v5 to load data from a CSV file, scale the population values linearly, and render the chart as an SVG. The code applies `scaleBand` for the categorical country axis and `scaleLinear` for the population axis, while `axisLeft` and `axisBottom` generate the tick marks and labels. Bars are drawn as SVG rectangles with a steelblue fill, and the chart includes margins and a rescaled population axis.
AI-generated descriptionMIT Licensed
Comments
Sign in to join the discussion.