🌍 Public
Viewing a saved revision (read-only)
4836adcf568a4a178ad49cae131b67f7
Bar graph
This example shows a horizontal bar chart ranking ten countries by population. The bars are rendered as SVG rectangles and filled with steelblue. The code uses d3.csv to load the data, then applies d3.scaleLinear for the x-axis and d3.scaleBand with padding for the y-axis. The axes are generated with d3.axisLeft and d3.axisBottom. Population values are converted from thousands to actual numbers before rendering, and the chart includes margins around the plotting area.
AI-generated description