Customizing the Axes
✓ Published1🌍 Public
This example displays a bar chart of the top 10 most populous countries in 2018, based on United Nations data. It shows how to customize D3 axes using d3-axis. The code uses d3.scaleBand and d3.scaleLinear to map country names and population values, d3.axisLeft and d3.axisBottom for the axes, and a custom tick format via d3.format to abbreviate large numbers. The axes have tick lines removed and grid lines added.
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.
MIT Licensed