Customizing Axes
✓ Published2🌍 Public
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 descriptionA bar chart of populations for the 20 largest countries in 2017 page.
See also React Starter.
MIT Licensed