Skip to main content
100%

Making a bar chart with D3.js

✓ Published2🌍 Public
Ddavidpiber
Last edited Nov 18, 2019
Created on Nov 17, 2019

This example displays a horizontal bar chart of population counts for ten countries, using data loaded from a CSV file. The chart maps population values to bar widths with `d3.scaleLinear` and country names to vertical positions with `d3.scaleBand`, rendering axes via `d3.axisLeft` and `d3.axisBottom`. Bars are drawn as SVG rectangles with a steelblue fill, and the population values are multiplied by 1000 during data parsing. The visualization is built entirely with D3.js v5, using its `select`, `csv`, and scale APIs.

AI-generated description
MIT Licensed

Similar vizzes