Skip to main content
100%

refactor axis with d3

✓ Published1🌍 Public
GGuitong Li
Last edited Feb 5, 2022
Created on Feb 5, 2022
Forked from axis with d3

A bar chart displays the population of the top 10 most populous countries from 2018 United Nations estimates. The visualization shows custom D3 axes built with React components, using `scaleBand` for the categorical y-axis and `scaleLinear` for the numeric x-axis. The `AxisBottom` component generates ticks and labels via `xScale.ticks()`, while `Marks` renders SVG rectangles with hover tooltips. Data loads asynchronously from a CSV file using `d3.csv` in the `useData` hook.

AI-generated description

This bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017. It also demonstrates customization of D3 axes.

See also the first bar chart visualization that this one builds on: Making a Bar Chart.

MIT Licensed

Similar vizzes