Making a Bar Chart
✓ Published0🌍 Public
This example shows a horizontal bar chart of population by country, using a CSV dataset that lists each nation and its population in thousands. The code builds the visualization with D3 v5, using `d3.csv` to load the data, `d3.scaleLinear` for the x-axis, and `d3.scaleBand` for the y-axis categories. SVG rectangles are appended to represent each bar, with their width mapped to population values and height determined by the band scale’s bandwidth.
AI-generated descriptionMIT Licensed