Skip to main content
100%

Making a Bar Chart

✓ Published1🌍 Public
EEugene
Last edited Feb 11, 2020
Created on Feb 6, 2020
Forked from Making a Bar Chart

This example displays the top 10 most populous countries as horizontal bars, using `d3.csv` to load data from the United Nations World Population Prospects 2019 and `d3.scaleLinear` and `d3.scaleBand` to map population and country names. The chart includes axes generated with `d3.axisLeft` and `d3.axisBottom`, rendered as SVG within a `g` element that respects explicit margins. The code appends rectangles with `selection.enter()` and sets their width and height based on the scales, although no gridlines or data labels are shown.

AI-generated description

A program that shows the top 10 most populous countries as a pathetic bar chart with no axes.

Data: United Nations World Population Prospects 2019.

MIT Licensed

Similar vizzes