Making a Bar Chart
✓ Published1🌍 Public
This example displays the top 10 most populous countries as horizontal bars, comparing 2018 population estimates from the United Nations. The code uses D3 v5 with SVG rendering, relying on `d3.csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to build the chart. Axes are customized by removing domain lines and formatting tick labels (e.g., converting “G” to “B” for billions), with a labeled x-axis and title. Population values are multiplied by 1000 to reflect the original UN data scale.
AI-generated descriptionThis bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017. It also demonstrates customization of D3 axes.
MIT Licensed