🌍 Public
Viewing a saved revision (read-only)
41120b8e14dc47d282b2f6e7d16ff5e6
Making a Bar Chart
This example shows a horizontal bar chart of the ten most populous countries, using the `d3.csv` loader to read the data file and the `d3.scaleLinear` and `d3.scaleBand` functions to map population and country names to the SVG canvas. The code builds the visualization by appending a `g` element, adds axes with `d3.axisLeft` and `d3.axisBottom`, and renders the bars as `rect` elements with a steelblue fill. The chart is a static SVG, with the y-axis labeled by country and the x-axis scaled to the population values.
AI-generated description