Skip to main content
100%

Margin in D3 Bar Chart UN World Population 2020

✓ Published1🌍 Public
DDhvanil Vaghasiya
Last edited Feb 2, 2023
Created on Jan 31, 2023

This example displays a horizontal bar chart of the population of the top ten countries in 2020, sourced from UN World Population Prospects 2019. It uses React to render SVG rectangles, with D3’s `scaleBand` and `scaleLinear` mapping country names and population values to positions and widths. A margin object defines the chart’s inner dimensions, and the bars are grouped within a translated `<g>` element. Loading is handled by `d3.csv` with a row function that parses the population column.

AI-generated description

A program that loads in some UN World Population Prospect 2019 using D3 utilities, and uses React to render the data as a pathetic Bar Chart

MIT Licensed

Similar vizzes