Customizing Axes
✓ Published1🌍 Public
This example shows a bar chart of the 2018 population estimates for the top 10 most populous countries, with a horizontal layout so country names are clearly readable. The code uses D3 v5’s `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to structure the visualization. It customizes the x-axis tick labels to abbreviate large numbers (e.g., converting 'G' to 'B' for billions) and adds grid lines via the `tickSize` option. Data is loaded from a CSV file using `d3.csv`.
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 2019.
MIT Licensed