Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

1567ee5d723146f6bc9386cf5a9605aa

Making a Bar Chart

0 stars0🌍 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.