Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a bar chart

Public visualization

Making a bar chart

0 stars1🌍 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

Comments

Sign in to join the discussion.

MIT Licensed