Making a bar chart
✓ Published2🌍 Public
This example shows a horizontal bar chart ranking the populations of the ten most populous countries, using data from a CSV file where values are multiplied by 1000. The visualization uses D3 v5’s `csv`, `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` APIs to map population to bar widths and country names to y-axis positions, rendering the bars as SVG rectangles. Axes are appended via `call`, and the chart is drawn within a fixed 960x500 SVG canvas with margins.
AI-generated descriptionMIT Licensed