Skip to main content
100%

Customize Axes

✓ Published1🌍 Public
Kkezianathania021@gmail.com
Last edited Sep 8, 2024
Created on Sep 8, 2024

This example visualizes the populations of the top 10 most populous countries as horizontal bars, showing each country's total population. The chart uses a linear scale for the population axis and a band scale for country names, with customized tick formatting that abbreviates numbers (converting gigabyte notation to billions). The code leverages d3's `scaleLinear`, `scaleBand`, `axisBottom`, and `axisLeft` to construct the axes, while `format('.3s')` handles number formatting. Data is loaded from a CSV file, with population values multiplied by 1000 during preprocessing.

AI-generated description
MIT Licensed

Similar vizzes