Making a Bar Chart
This bar chart displays the population of the top 10 most populous countries, using 2018 estimates from the United Nations World Population Prospects 2017. It shows the data with horizontal bars arranged by country, with a formatted x-axis using a custom `replace('G', 'B')` on `d3.format`, and a removed y-axis domain and ticks for a cleaner look. Built with D3 v5, the chart uses `select`, `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, `axisBottom`, and `max` from the D3 API, and renders as an SVG. The data is loaded from a local `data.csv` file, with population values multiplied by 1000 during preprocessing.
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.