Skip to main content
100%

React D3 Axes

✓ Published1🌍 Public
Ttrissentety
Last edited Feb 6, 2023
Created on Feb 5, 2023
Forked from Margin Convention

This example displays the top 10 most populous countries from the United Nations World Population Prospects 2019 dataset as a horizontal bar chart, using React for component structure and d3.scaleBand, d3.scaleLinear, and d3.max for scaling. The SVG rendering includes manually constructed axes, with x-axis ticks generated via xScale.ticks() and y-axis labels positioned using scaleBand's bandwidth. The code loads CSV data via d3.csv in a useEffect hook and renders rectangles for each bar.

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