Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart!

Public visualization

Viewing a saved revision (read-only)

5b1961e907e7469ba12a4cfd04d3de5e

Making a Bar Chart!

0 stars0🌍 Public
IIgnacio Esquivel
Last edited May 30, 2020
Created on May 30, 2020

This example demonstrates the basic process of creating a bar chart with D3. It shows population values for several countries as horizontal bars, using an SVG canvas. The code loads data from a CSV file and scales the bar widths with `d3.scaleLinear`, while `d3.scaleBand` is intended for the y-axis positioning. It relies on D3 v5’s `select`, `csv`, and `max` functions to bind data to SVG `<rect>` elements.

AI-generated description