Making a Bar Chart
✓ Published1🌍 Public
This example displays the top 10 most populous countries as horizontal bars, using `d3.csv` to load data from the United Nations World Population Prospects 2019 and `d3.scaleLinear` and `d3.scaleBand` to map population and country names. The chart includes axes generated with `d3.axisLeft` and `d3.axisBottom`, rendered as SVG within a `g` element that respects explicit margins. The code appends rectangles with `selection.enter()` and sets their width and height based on the scales, although no gridlines or data labels are shown.
AI-generated descriptionA program that shows the top 10 most populous countries as a pathetic bar chart with no axes.
MIT Licensed