Customizing Axes
This example displays a horizontal bar chart of the population of the ten most populous countries, using data from the 2019 United Nations World Population Prospects. The chart features custom axis formatting: y-axis labels are stripped of their default domain and tick lines, while the x-axis converts tick labels to localized German abbreviations like "Mio" and "Mrd." The code uses `d3.csv` to load data, `scaleLinear` and `scaleBand` to map values, and `axisBottom` and `axisLeft` to generate axes. Bar rectangles are appended to an SVG element, and styles are applied via an external stylesheet.
AI-generated descriptionThis bar chart shows population of the top 10 most populous countries. The data comes from the year 2019 estimate in United Nations: World Population Prospects 2019.