Making a Bar Chart
✓ Published2🌍 Public
This example shows a horizontal bar chart of the ten most populous countries, with country names on the y-axis and population on the x-axis. The bars are rendered as SVG rectangles, filled with steelblue. The code uses d3.csv to load the data, d3.scaleLinear and d3.scaleBand to map values to coordinates, and d3.axisLeft and d3.axisBottom to draw the axes. The population values are parsed and multiplied by 1,000.
AI-generated descriptionMIT Licensed