Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Activity 6

Public visualization

Activity 6

0 stars0🌍 Public
Mmayasuedorman@gmail.com
Last edited Oct 25, 2024
Created on Oct 23, 2024
Forked from Hello VizHub

This example uses a horizontal bar chart rendered with React and SVG to compare the 2010 populations of twenty countries. The chart sorts countries vertically using an ordinal scale and encodes population values with a linear scale, formatting large numbers with abbreviations (e.g., “1.5B”). It pulls data from a CSV file hosted on GitHub. The code leverages d3’s `scaleBand`, `scaleLinear`, `format`, and `csv` functions, along with custom React components (`AxisBottom`, `AxisLeft`, `Marks`) that render SVG elements. Tooltips display the formatted population value for each bar.

AI-generated description

A demonstration of how to start using D3 version 6.

Comments

Sign in to join the discussion.

MIT Licensed