Skip to main content
100%

Pathetic bar chart fork

✓ Published1🌍 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.

MIT Licensed

Similar vizzes