Viewing a saved revision (read-only)
5da8cb678c8b41f29bdfd5c575db47ae
Customizing Axes
A horizontal bar chart displays the 2018 population estimates for the top 10 most populous countries from the UN World Population Prospects. The example shows customized axes, using `scaleBand` for countries and `scaleLinear` for population values in thousands. It formats tick labels with `d3.format` to abbreviate large numbers, replacing 'G' with 'B' for billions. Bars are rendered in SVG, with the bottom axis positioned inside the chart and the left axis drawn separately using `d3.axisLeft`.
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.