Skip to main content
100%

Make bar chart with React using D3

✓ Published0🌍 Public
Dducan114
Last edited Dec 28, 2021
Created on Dec 28, 2021

This example shows a horizontal bar chart of the ten most populous countries in 2020, using data loaded from a CSV file via `d3.csv`. The chart maps country names to a `scaleBand` on the y-axis and population values to a `scaleLinear` on the x-axis, rendering each bar as an SVG `<rect>` element. Built with React and D3 v7, the component fetches data asynchronously in a `useEffect` hook and stores it with `useState`, updating the visualization once loaded.

AI-generated description

Smiley face implementation with React.

MIT Licensed

Similar vizzes