Skip to main content
100%

Fork of Axes with React & D3

✓ Published0🌍 Public
SSophia Chiao
Last edited May 23, 2022
Created on May 23, 2022

This example displays the top 10 most populous countries as a horizontal bar chart with custom axes. It uses React hooks (useState, useEffect, and useCallback) to load data from the United Nations World Population Prospects 2019 via d3.csv, then renders SVG bars and axes. The chart builds axes manually with d3.scaleBand and d3.scaleLinear, using d3.ticks for x-axis tick values and computed positions for y-axis labels, rather than using d3.axisBottom or d3.axisLeft.

AI-generated description

A program that shows the top 10 most populous countries as a pathetic bar chart with no axes.

Data: United Nations World Population Prospects 2019.

MIT Licensed

Similar vizzes