Skip to main content
100%

Customizing Axes

✓ Published1🌍 Public
NNita
Last edited Mar 12, 2021
Created on Dec 26, 2019
Forked from Scatter plot

This example displays a bar chart of the top 10 most populous countries in 2018, using population estimates from the United Nations World Population Prospects. It builds on the basic bar chart by customizing D3 axes, removing the default domain lines and tick marks, and reducing y-axis clutter. The x-axis uses a custom tick format to abbreviate large numbers (e.g., “1.4B”), and both axis labels and the title are styled via CSS. The implementation uses D3 v5's `scaleLinear`, `scaleBand`, `axisBottom`, and `axisLeft` APIs with an SVG rendering.

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