Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

bar chart using react and d3

Public visualization

bar chart using react and d3

0 stars2🌍 Public
BBrian Machado
Last edited Jul 4, 2022
Created on Jul 2, 2022

This example shows a horizontal bar chart of the ten most populous countries for 2020, using population data loaded from a CSV file. The chart is rendered as SVG within a React application, with each bar’s length proportional to the country’s population. The code uses React’s `useState` and `useEffect` hooks to fetch and parse the data with `d3.csv`, then employs `d3.scaleBand` and `d3.scaleLinear` to map countries and population values to the chart’s dimensions.

AI-generated description

Smiley face implementation with React.

Comments

Sign in to join the discussion.

MIT Licensed