Skip to main content
100%

Bar chart with D3

✓ Published0🌍 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

MIT Licensed

Similar vizzes