Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Bar chart with D3

Public visualization

Viewing a saved revision (read-only)

5ed3bb9227234305837ef64917816aba

Bar chart with D3

0 stars0🌍 Public
Eekmankaur
Last edited Oct 12, 2022
Created on Oct 11, 2022

This bar chart displays the population of the top 10 countries for 2020, using horizontal bars sorted by country name. The chart is built with React and D3 v5, rendering SVG elements. The code defines custom `AxisBottom`, `AxisLeft`, and `Marks` components, using D3's `scaleBand` and `scaleLinear` for scales and `format` for tick labels. Data is loaded from a CSV URL using `d3.csv`, and population values are computed by multiplying the '2020' column by 1000.

AI-generated description

Bar chart + the margin convention + axes + refactoring + stylized