Customizing Axes
✓ Published1🌍 Public
This bar chart shows the populations of the top 10 most populous countries in 2018, sourced from the United Nations World Population Prospects. The horizontal bars are ordered by country name, with a linear x-axis and a banded y-axis. The code uses D3 v5’s `scaleLinear`, `scaleBand`, `axisBottom`, and `axisLeft` to draw axes, while custom tick formatting converts large numbers into abbreviated units like “B” for billions. The x-axis gridlines extend across the chart via negative tick sizes, and the axis labels and title are styled with CSS.
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.
MIT Licensed