Skip to main content
100%

Making a bar chart

✓ Published1🌍 Public
Lloisasy
Last edited Jan 21, 2020
Created on Jan 21, 2020

This example shows a horizontal bar chart of the ten most populous countries, with each bar’s length representing population in thousands. It uses D3 v5’s `scaleLinear` for the x-axis, `scaleBand` for the categorical y-axis, and `axisLeft` and `axisBottom` for the tick marks and labels. The SVG-based visualization loads data from a local CSV file via `d3.csv`, converts the population values with a unary plus operator, and appends rectangles to a group element with explicit margins.

AI-generated description
MIT Licensed

Similar vizzes