Making a Bar Chart
This bar chart displays the populations of the ten most populous countries, using 2018 estimates from the United Nations World Population Prospects 2017. The data is loaded from a CSV file and rendered as SVG rectangles. The code uses d3.csv, d3.scaleLinear, d3.scaleBand, d3.axisLeft, and d3.axisBottom to map population values to bar widths and country names to vertical bands. Each rectangle’s width corresponds to the population, with values scaled in thousands as specified in the dataset.