Making a Bar Chart
✓ Published0🌍 Public
This example shows a horizontal bar chart of the populations of the ten most populous countries, ordered from largest to smallest. It uses D3 v5 to load data from a CSV file and render the visualization as SVG. The code explicitly calls `scaleLinear` and `scaleBand` to create the x and y scales, `axisLeft` and `axisBottom` to generate the axes, and uses `select` to target the SVG element. The bars are colored steel blue via CSS, and the population values are transformed by multiplying by 1000 before rendering.
AI-generated descriptionMIT Licensed