Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Pathetic bar chart fork

Public visualization

Viewing a saved revision (read-only)

aff7c0ba8812475883a814ada3b98db8

Pathetic bar chart fork

0 stars1🌍 Public
Ssurikmeetr
Last edited Mar 5, 2021
Created on Mar 5, 2021

This example renders a horizontal bar chart of the top 10 most populated countries for 2020, using data loaded from a CSV file via D3’s `csv()` utility. React state and the `useEffect` hook manage the asynchronous data fetch, while D3’s `scaleBand` and `scaleLinear` define the y- and x-axes. Each country is represented as an SVG `<rect>` element, with its width proportional to population, and the chart updates reactively once the data arrives.

AI-generated description

loading data about css colors with d3 utilities and using react to render data.