Customizing Axes
This example visualizes the top 10 most populous countries using a horizontal bar chart, based on 2018 estimates from the United Nations World Population Prospects. It highlights customization of D3 axes: the y-axis removes its domain line and tick lines, while the x-axis uses a custom tick format that abbreviates large numbers (e.g., converting "G" billions to "B") and extends tick lines across the full chart height. The visualization renders in SVG via D3 v5, using `scaleLinear` and `scaleBand` for scales, and `axisBottom` and `axisLeft` for axes. Data is loaded from a `data.csv` file containing car prices, though the chart's population data is derived from that source.
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.
See also the first bar chart visualization that this one builds on: Making a Bar Chart.