Skip to main content
100%

Axes with React & D3

✓ Published0🌍 Public
JJadeJOy
Last edited Mar 26, 2021
Created on Mar 26, 2021

This example renders a bar chart of the top 10 most populous countries from United Nations World Population Prospects 2019 data, displayed using React-managed SVG elements. D3 v5 provides the scales: `scaleBand` for countries on the y-axis and `scaleLinear` for population on the x-axis, with manually drawn axis ticks and labels computed via `xScale.ticks()`. React hooks `useState` and `useEffect` handle asynchronous CSV loading and data updates. The chart lacks axis lines or gridlines, showing only tick marks and country names.

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