🌍 Public
Viewing a saved revision (read-only)
9464cb2cfe334e11af9a9716bbbe7b69
Fork of Activity 7
This example shows a horizontal bar chart of the top 20 countries by 2020 population, using a React-based SVG rendering. It maps the `Population` values to bar widths and `Country` names along the left axis, formatting population figures with D3’s `format('.2s')` to display billions. The code loads CSV data via `d3.csv`, then scales the bars using `scaleBand` and `scaleLinear`. Axis components are built manually with React, and tooltips are provided through SVG `<title>` elements. The chart’s styling includes blue tick lines, green bars, and a Poppins font.
AI-generated descriptionA demonstration of how to start using D3 version 6.