D3 Exercise - Bar Chart
✓ Published1🌍 Public
This bar chart visualizes the population of ten countries, using a horizontal bar for each nation ordered by population size. The chart is built with D3 version 6, using the `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` modules from the D3 API. The data is loaded from a local CSV file via D3’s `csv` function, with population values parsed and multiplied by 1,000. The SVG rendering is driven by a `select`-based pipeline, appending rectangles whose widths and y-positions are computed from the scales. The visualization appears clean and readable with fixed margins and a steelblue bar fill.
AI-generated descriptionMIT Licensed