Custominzing Axes
✓ Published1🌍 Public
This bar chart displays the population of the top 10 most populous countries in 2018, based on United Nations data. It uses a linear x-scale for population and a banded y-scale for country names. The code employs D3 v5’s `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` APIs to render axes, with tick labels formatted using `format(".3s")` and a custom replacement of 'G' with 'B' for billions. Grid lines are drawn via `tickSize(-innerHeight)`, and the chart is rendered as SVG.
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.
MIT Licensed