Skip to main content
100%

Fork of React & D3 - Bar Chart with Axes and Margin

✓ Published1🌍 Public
NNika
Last edited Apr 5, 2021
Created on Apr 5, 2021

This interactive bar chart displays United Nations population data for countries from 1950 onward, with a numeric input allowing the user to switch between years. The visualization uses React state to manage the selected year and fetched CSV data, while D3 v6 scales (d3.scaleLinear and d3.scaleBand) map population values to horizontal bar lengths and country names to vertical bands. Bars are rendered as SVG rectangles, colored via d3.scaleLinear with d3.interpolateHcl from red to green based on population magnitude, and positioned within explicit margins on a 960x500 canvas.

AI-generated description
MIT Licensed

Similar vizzes