🌍 Public
Viewing a saved revision (read-only)
2dff2b1e89494a57ac0ba3e28cba0e37
Making a bar chart
This example shows a horizontal bar chart of population by country, ranking the ten most populous nations from China to Mexico. It uses d3.csv to load the data, d3.scaleLinear for the x-axis population scale, and d3.scaleBand for the categorical y-axis. The chart renders as SVG rectangles with steelblue fill, with d3.axisLeft and d3.axisBottom providing labeled scales. Margins and a group transform position the plot, while the population values are multiplied by 1000 to reflect full counts.
AI-generated description