Skip to main content
100%

The Margin Convention

✓ Published1🌍 Public
WWaseem Medhat
Last edited Oct 18, 2020
Created on Oct 18, 2020
Forked from Pathetic Bar Chart

This example shows a horizontal bar chart of the top 10 most populous countries in the world for 2020, with the D3 margin convention demonstrated by a chart area inset from the SVG edges. It renders an SVG using React, pulling data from a CSV of UN population figures. The code uses `d3.csv`, `scaleLinear`, and `scaleBand` to map population values and country names to x and y scales, while axes are drawn manually with `xScale.ticks()` and gridlines.

AI-generated description

Basic D3 bar chart (with React). It includes basic rendering, filtering data before visualization, and the margin convention.

MIT Licensed

Similar vizzes