Customizing Axes
This bar chart displays the top 10 most populous countries using 2018 estimates from the United Nations World Population Prospects, with population values formatted in billions. The example builds on a basic bar chart by customizing both axes: the left axis removes tick lines and domain, while the bottom axis uses a tick format that converts "G" to "B" for billions and spans the full inner height. The code employs D3 v5 modules including `scaleLinear`, `scaleBand`, `axisBottom`, `axisLeft`, and `format`, rendering SVG elements with custom axis labels and a title. Population data loads from a CSV file and is multiplied by 1000 to reflect actual figures.
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.
See also the first bar chart visualization that this one builds on: Making a Bar Chart.