Skip to main content
100%

Making a Bar Chart

✓ Published0🌍 Public
JJens Grochtdreis
Last edited Apr 19, 2020
Created on Apr 19, 2020
Forked from Making a Bar Chart

This example demonstrates how to build a horizontal bar chart from scratch using D3 v5 in a React framework. The visualization displays population data for ten countries, with bars rendered as SVG rectangles scaled linearly by population and positioned using a band scale for country names. The code explicitly uses D3’s `scaleLinear`, `scaleBand`, `axisLeft`, and `axisBottom` functions, reading data from a CSV file. Axes are appended to a grouped SVG element, and bar heights are determined by the band scale’s bandwidth.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes