Skip to main content
100%

Activity6_population

✓ Published0🌍 Public
Sskykarthik97@gmail.com
Last edited Apr 11, 2024
Created on Apr 11, 2024
Forked from Hello VizHub

This example shows a horizontal bar chart of the populations of 20 countries in 2010, ordered by country name. The chart uses D3’s `scaleBand` and `scaleLinear` to map countries and population values to SVG rectangles, with axes built from custom React components. Population values are formatted with D3’s `format` function, converting values like “1.2G” to “1.2B”. The data is loaded asynchronously from a CSV file via `d3.csv`, and the rendering is done through React with SVG, using a light green fill for the bars and tooltips provided by SVG `<title>` elements.

AI-generated description

A demonstration of how to start using D3 version 6.

MIT Licensed

Similar vizzes