Making a Bar Chart with React & D3 (Tutorial 21)
✓ Published1🌍 Public
TTom-S82
Last edited Aug 31, 2020
Created on Aug 31, 2020
This example shows a horizontal bar chart of the estimated 2020 populations for the top ten countries, sourced from a UN population CSV file. Built with React and D3 v5, it renders as an SVG, using `d3.scaleBand` and `d3.scaleLinear` to map country names and population values to rectangular coordinates. The chart uses the `d3.max` function to determine the scale domain and React’s `useState` and `useEffect` hooks to asynchronously load and slice the data for display.
AI-generated descriptionA program that creates a bar chart based on estimated UN Population levels in 2020.
Tutorial Sources:
Documentation:
MIT Licensed