Making a Bar Chart
✓ Published0🌍 Public
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 descriptionMIT Licensed