Skip to main content
100%

Customizing Axes

✓ Published0🌍 Public
EEbenezer Oladutemu
Last edited May 29, 2020
Created on May 15, 2020
Forked from Customizing Axes

This example visualizes the population of the top 10 most populous countries from the United Nations' 2018 World Population Prospects, using a bar chart with customized axes. The chart displays country names on the y-axis and population values on the x-axis, with gridlines extending across the plot. Built with D3 v5, the code uses `d3.axisBottom` and `d3.axisLeft` to generate axes, and customizes tick formatting via `d3.format` (converting "G" to "B" for billions). The x-axis label and title are added as text elements, while tick lines and domain paths are selectively removed or styled through CSS.

AI-generated description

This bar chart shows population of the top 10 most populous countries. The data comes from the year 2018 estimate in United Nations: World Population Prospects 2017. It also demonstrates customization of D3 axes.

See also the first bar chart visualization that this one builds on: Making a Bar Chart.

MIT Licensed

Similar vizzes