Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

bcc3be3c62654612a161c0271badb17e

Making a Bar Chart

0 stars0🌍 Public
Rryanrholler
Last edited Feb 1, 2020
Created on Feb 1, 2020

This example shows a horizontal bar chart of population estimates for the ten most populous countries, with bar lengths proportional to each country’s population. Using D3 v5, it loads CSV data via `d3.csv`, converts the population values to numbers, and maps them to pixel widths with `d3.scaleLinear`. The chart renders as SVG rectangles appended to the page, each with a fixed height of 300 pixels, demonstrating a basic data-binding workflow with `.data()` and `.enter()`.

AI-generated description