Customizing axes
✓ Published0🌍 Public
This example displays a horizontal bar chart of the ten most populous countries, with population values scaled linearly and countries ordered by rank on a band scale. The visualization customizes both axes by removing their default domain lines and ticking, while formatting population ticks to abbreviate billions as “B” via d3.format. It also applies a tick size that extends grid lines across the chart. The code uses d3.scaleLinear, d3.scaleBand, d3.axisBottom, d3.axisLeft, and d3.csv to load the population data, rendering SVG rectangles with steelblue fill.
AI-generated descriptionMIT Licensed