Making a Bar Chart
✓ Published1🌍 Public
This example displays the top 10 most populous countries as horizontal bars, with country names on the y-axis and population counts along the x-axis. The chart uses data from the United Nations World Population Prospects 2019, loaded from a CSV file. Constructed with D3 v5, the code uses `select`, `csv`, `scaleLinear`, `scaleBand`, `max`, `axisLeft`, and `axisBottom` to define scales and render SVG rectangles. The bar lengths encode each nation’s population, drawn in steel blue with an accompanying axis for reference.
AI-generated descriptionA program that shows the top 10 most populous countries as a bar chart.
MIT Licensed