🌍 Public
Viewing a saved revision (read-only)
d0203d3bde3a4ceb946ea604fc2f7d51
Making a Bar Chart
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 description