Customizing Axes
This example shows the top 10 most populous countries in 2018, using a horizontal bar chart with customized axes. It builds on a basic bar chart by removing unnecessary axis lines, using d3.axisBottom and d3.axisLeft, and formatting tick labels with d3.format to display populations in billions. The code loads data from a CSV file and uses d3.scaleLinear and d3.scaleBand for positioning. Light gray grid lines extend from the x-axis ticks, and the chart includes custom titles and axis labels.
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.