Customising Axes with d3
✓ Published1🌍 Public
This example shows a horizontal bar chart of the ten most populous countries, using data from a CSV file. Population values are converted from thousands to raw numbers, and d3.scaleLinear and d3.scaleBand map the data to SVG rectangles. Custom axis styling is applied with d3.axisLeft and d3.axisBottom, including a custom tick formatter that uses d3.format to abbreviate large numbers with "B" for billions. Grid lines are added via tickSize, while axis domains and tick lines are selectively removed.
AI-generated descriptionMIT Licensed