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
Ddanielchamone
Last edited Oct 31, 2019
Created on Oct 29, 2019
Forked from Making a Bar Chart

This example uses a static dataset of 2017 population estimates for twelve countries, rendered as horizontal bars with `d3.scaleLinear` and `d3.scaleBand`. A D3 selection appends SVG `rect` elements whose widths are proportional to each country’s population, with axes created via `d3.axisLeft` and `d3.axisBottom`. The code loads `data.csv` asynchronously with `d3.csv`, converts population values to thousands, and applies margins to position the chart within an SVG of 960 by 500 pixels.

AI-generated description

This is a population chart by country.

Comments

Sign in to join the discussion.

MIT Licensed