Making a Bar Chart
✓ Published2🌍 Public
This example visualizes the top 10 most populous countries using a horizontal bar chart ordered by population. The chart displays population values on the x-axis with tick labels formatted in billions (e.g., "1.42B") and country names on the y-axis. It uses D3 v5’s `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load data and render SVG elements programmatically. The bars are filled with steelblue, and axis lines are removed for a cleaner presentation. The data comes from `data.csv`, which is loaded asynchronously via D3’s `csv` function.
AI-generated descriptionMIT Licensed