Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

c0ebf72f60724b2097f8671810e8d22d

Making a Bar Chart

0 stars1🌍 Public
CCodeHandLuke
Last edited Aug 13, 2019
Created on Aug 13, 2019

This example shows a horizontal bar chart of the ten most populous countries, with bar lengths proportional to each country's population. It uses D3 version 5 APIs including `select`, `csv`, `scaleLinear`, `max`, and `scaleBand` to load data from a CSV file, compute scales, and render SVG rectangles. The chart applies a linear scale to population values and a band scale to country names, with bars drawn inside an SVG element with fixed dimensions and a margin offset.

AI-generated description