🌍 Public
Viewing a saved revision (read-only)
b782e2167cb5437fbce4e1be4da5db60
Customizing Axes and Numbers
This example displays a horizontal bar chart of the world’s top 10 most populous countries, with populations from a CSV file scaled by 1,000. It uses d3.csv, d3.scaleLinear, and d3.scaleBand to map data to bar lengths and country names on the y-axis. The chart customizes the x-axis with d3.format('.3s') to abbreviate numbers and replaces “G” with “B” for billions, while removing y-axis domain lines and adding axis labels via d3.axisBottom and d3.axisLeft. All rendering is done in SVG with styled rectangles and text.
AI-generated description