Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Task1_activity7

Public visualization

Viewing a saved revision (read-only)

29864b32dafa42c4889fabc1e51c2592

Task1_activity7

0 stars4🌍 Public
Ppavanpkkalyan3@gmail.com
Last edited Apr 11, 2024
Created on Apr 11, 2024
Forked from Activity 7

This example shows a horizontal bar chart ranking the populations of ten countries in the year 2000, using a dataset loaded from a GitHub-hosted CSV file. The bars are rendered as SVG rectangles via React components, with D3’s `scaleBand` and `scaleLinear` mapping country names and population values to positions and lengths. Axis components generate ticks and labels, while a `format` function converts numbers into abbreviated units like billions. The code initializes data asynchronously with `useEffect` and `csv`, and applies a custom CSS style for tick lines and bar fills.

AI-generated description

A demonstration of how to start using D3 version 6.