Customizing Axes
This example displays a bar chart of the top 10 most populous countries in 2018, based on United Nations data. It highlights customized D3 axes, including a formatted x-axis using `format('.3s')` to abbreviate population values and gridlines via `tickSize`. The y-axis removes its domain and tick lines for a cleaner look, while axis labels and a title are added using SVG text elements. The code uses `d3.csv`, `scaleLinear`, `scaleBand`, `axisBottom`, and `axisLeft` to build the visualization.
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.