Customizing Axes
This example shows a horizontal bar chart of population for the top 10 most populous countries, using 2018 estimates from the United Nations World Population Prospects. It demonstrates how to customize D3 axes by removing domain lines, adjusting tick sizes and formats (using d3.format to abbreviate large numbers), and adding axis labels. The visualization uses D3 v5 with d3.scaleBand and d3.scaleLinear for scales, and d3.axisLeft and d3.axisBottom for rendering axes as SVG elements, with custom styling applied via 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. It also demonstrates customization of D3 axes.
See also the first bar chart visualization that this one builds on: Making a Bar Chart.