Skip to main content
100%

Fork of Axes with React & D3

✓ Published0🌍 Public
Mmedi11
Last edited Apr 6, 2022
Created on Apr 6, 2022

This example visualizes the top 10 most populous countries as a horizontal bar chart with axes, using React for component structure and D3 for data loading and scales. The chart displays population values from the United Nations World Population Prospects 2019 dataset on the x-axis, while country names appear on the y-axis. The code uses D3’s `csv`, `scaleBand`, `scaleLinear`, and `max` functions to process data and position bars, with tick marks and labels generated manually via `xScale.ticks()`. All elements are rendered as SVG through React’s declarative JSX, with margins applied via a transform group.

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