Skip to main content
100%

Customizing Axes and Numbers

✓ Published1🌍 Public
AAbhishek Chandarana
Last edited Aug 20, 2020
Created on Aug 20, 2020

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
MIT Licensed

Similar vizzes