Making a Bar Chart
✓ Published4🌍 Public
This example shows a horizontal bar chart of country populations, ranking thirteen nations from China to the Philippines. The bars are rendered as SVG rectangles filled with steel blue, with a left axis displaying country names and a bottom axis showing population counts. The chart uses d3.csv to load the data, d3.scaleLinear and d3.scaleBand for scaling, and d3.axisLeft and d3.axisBottom to generate the axes. Population values are converted from thousands using array methods before rendering.
AI-generated descriptionMIT Licensed