Skip to main content
100%

Bar Chart with React

✓ Published0🌍 Public
Ddrc6587
Last edited Aug 5, 2022
Created on Jul 30, 2022

A bar chart displays the top 10 countries by 2020 population, sourced from a UN Population CSV loaded via `d3.csv`. The React component uses `useState` and `useEffect` to fetch and store data, then renders an SVG with `d3.scaleBand` for countries on the y-axis and `d3.scaleLinear` for population on the x-axis. Gridlines and tick labels are generated from `xScale.ticks()`, while each bar is a `<rect>` with fill opacity and stroke styling.

AI-generated description

A progam that loads data using D3 utilities and uses React state to render the data

5:17:45

MIT Licensed

Similar vizzes