🌍 Public
Viewing a saved revision (read-only)
8790ed31d1f64b4cb0142a719e1daa60
Making a Bar Chart
This example shows a horizontal bar chart of male population estimates for ten countries, ordered by descending value. The visualization encodes population numbers as bar lengths and country names along the vertical axis using an SVG rendering. The code uses d3.csv to load the data, d3.scaleLinear and d3.scaleBand for positioning and sizing, and d3.axisLeft and d3.axisBottom to draw the axes. Steel-blue rectangles represent the bars, with a 110-pixel left margin accommodating country labels.
AI-generated description