🌍 Public
Viewing a saved revision (read-only)
2b854ba2cdcc43f8b0b80ff96bf3bba7
Making a bar chart
This example uses d3.csv, d3.scaleLinear, d3.scaleBand, d3.axisLeft, and d3.axisBottom to render a horizontal bar chart of country populations from a CSV file. The data is loaded asynchronously and parsed to numeric population values. Rectangles are appended to an SVG group, positioned with the band scale and sized by the linear scale, while axes are added via selection calls. The chart displays ten countries in descending order of population, with steelblue bars and light styling.
AI-generated description).