Making a Bar Chart
✓ Published1🌍 Public
This example uses a static dataset of 2017 population estimates for twelve countries, rendered as horizontal bars with `d3.scaleLinear` and `d3.scaleBand`. A D3 selection appends SVG `rect` elements whose widths are proportional to each country’s population, with axes created via `d3.axisLeft` and `d3.axisBottom`. The code loads `data.csv` asynchronously with `d3.csv`, converts population values to thousands, and applies margins to position the chart within an SVG of 960 by 500 pixels.
AI-generated descriptionThis is a population chart by country.
MIT Licensed