Skip to main content
100%

Customizing Axes

✓ Published2🌍 Public
Ssunilkrishnav
Last edited Mar 22, 2020
Created on Mar 22, 2020
Forked from Customizing Axes

This example displays a bar chart of the top 10 most populous countries using 2018 population estimates from the United Nations World Population Prospects 2017, with data loaded via d3.csv. It shows how to customize D3 axes: the y-axis uses d3.axisLeft with its domain and tick lines removed, while the x-axis uses d3.axisBottom with a custom tick format that converts values from billions to a readable "B" suffix and extends tick lines across the chart. The code employs d3.scaleLinear and d3.scaleBand to map data to SVG rectangles, with styling for tick text, labels, and titles defined in 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