Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Margins & Axes

Public visualization

Viewing a saved revision (read-only)

1bcfc2e3aeee491cac48e8da577a3398

Margins & Axes

0 stars0🌍 Public
GGuus Lammers
Last edited Mar 3, 2022
Created on Mar 3, 2022
Forked from Pathetic Bar Chart

This example displays the top 10 most populous countries as a bar chart, with country names on a band scale y-axis and population values on a linear x-axis, all framed by explicit margins. It uses React state to asynchronously load CSV data via `d3.csv` from the United Nations World Population Prospects 2019. The SVG rendering leverages `d3.scaleBand`, `d3.scaleLinear`, and `d3.max` to compute scales, while ticks for both axes are generated manually using `xScale.ticks()` and the domain values, with a `translate` transform to offset the chart within the margins.

AI-generated description

A program that shows the top 10 most populous countries as a pathetic bar chart with no axes.

Data: United Nations World Population Prospects 2019.