🌍 Public
Viewing a saved revision (read-only)
ba21af6645bc4d3ea97914615ece260e
Making a Bar Chart
This example shows the population of ten countries as horizontal bars, with bar length representing population and each bar labeled by country name. It uses d3.scaleLinear for the x-axis and d3.scaleBand for the y-axis, loading data from an external CSV file with d3.csv. The SVG rectangles are appended and sized directly through D3’s data join, with population values converted from thousands to raw counts before rendering.
AI-generated description