🌍 Public
Viewing a saved revision (read-only)
39cf20a44e274e6c93b91eadeb2a5662
Making a Barchart
This example shows a horizontal bar chart comparing the populations of ten countries, from China to Mexico. The chart uses D3 v5 APIs including `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` to load the data, map values to positions, and render axes. Bars are drawn as SVG `rect` elements with a steelblue fill, and population values are multiplied by 1000 in the data-loading step before the visualization is rendered. The layout applies margins and transforms the main group to position the chart within the SVG canvas.
AI-generated description