Skip to main content
100%

Customizing Axes

✓ Published2🌍 Public
JJames Barbour, Jr.
Last edited Apr 17, 2020
Created on Apr 9, 2020
Forked from Making a bar Chart

This example visualizes the 20 largest countries by population in 2017 as a horizontal bar chart, using a linear x-axis scaled to population values and a band y-axis for country names. The axes are customized: the x-axis formats tick labels in compact notation (e.g., “1.41B”) and draws grid lines, while the y-axis removes its domain and tick lines. The code uses d3.csv, d3.scaleLinear, d3.scaleBand, d3.axisBottom, and d3.axisLeft within a React setup, rendering SVG bars with steelblue fills.

AI-generated description

A bar chart of populations for the 20 largest countries in 2017 page.

See also React Starter.

MIT Licensed

Similar vizzes