Skip to main content
100%

dv.22.1 - the margin convention

✓ Published1🌍 Public
Zzach b.
Last edited Mar 19, 2021
Created on Nov 2, 2020

This example shows a horizontal bar chart of the top 20 most populous countries, with only rectangular bars and no axes or labels. The chart uses the margin convention by defining a margin object and translating an inner `<g>` element by those offsets, leaving space around the plot area. React state stores the CSV data from the United Nations World Population Prospects 2019, loaded via `d3.csv` with a row function that parses the '2020' population field. Bars are rendered as SVG `<rect>` elements sized using `d3.scaleBand` for the y-axis and `d3.scaleLinear` for the x-axis.

AI-generated description

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

Data: United Nations World Population Prospects 2019.

--
Datavis 2020 #22

MIT Licensed

Similar vizzes