Skip to main content
100%

Crappy Bar Chart with React and D3

✓ Published1🌍 Public
Ddaneslutzky
Last edited Sep 14, 2021
Created on Sep 13, 2021

This example displays a horizontal bar chart of the top ten countries by 2020 population, using UN population data loaded via `d3.csv`. React manages the component state and renders SVG `<rect>` elements, while D3’s `scaleBand` and `scaleLinear` position and size the bars. The `useEffect` hook fetches the CSV once, and `max` computes the domain for the x-axis. Although titled "crappy," the chart cleanly shows relative population sizes.

AI-generated description

A program that loads data about CSS named colors and uses React to render the data.

MIT Licensed

Similar vizzes