Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart with React & D3

Public visualization

Viewing a saved revision (read-only)

cd1b79f25b3f4e90b97028ffdae7d912

Making a Bar Chart with React & D3

0 stars1🌍 Public
NNarottam Medhora
Last edited Mar 21, 2022
Created on Mar 21, 2022

This example shows a horizontal bar chart of the top 10 most populous regions and countries for 2020, rendered as SVG elements. The React component uses the `useState` and `useEffect` hooks to load data from a CSV file via D3’s `csv` utility, then maps that data to `<rect>` elements. D3’s `scaleBand` and `scaleLinear` position the bars vertically and size their widths, while `max` determines the domain for the linear scale.

AI-generated description

A program that loads in some data about CSS named colors using D3 utilities, and uses React to render the data as a radial burst!