Skip to main content
100%

Making a Bar Chart with React

✓ Published1🌍 Public
OOscar
Last edited Jan 21, 2026
Created on Jan 19, 2026

This example shows a horizontal bar chart of the top 10 countries by population in 2020, with rectangular marks colored teal and a formatted axis labeling values in billions. Built with React and D3 v5, it uses scaleBand for the y-axis, scaleLinear for the x-axis, and separates chart elements into reusable components like AxisBottom, AxisLeft, and Marks. Population data is loaded from a CSV file using d3.csv, and the SVG is rendered entirely through React.

AI-generated description
MIT Licensed

Similar vizzes