Skip to main content
100%

customizing axes

✓ Published5🌍 Public
Nnexus1058
Last edited Jan 5, 2021
Created on Dec 12, 2020
Forked from making a bar chart

This example displays a horizontal bar chart of the ten most populous countries, based on 2018 data from the United Nations World Population Prospects. Population values are encoded by bar length using d3.scaleLinear, while country names are positioned on a categorical d3.scaleBand axis. The chart customizes its axes by removing default domain lines, applying a custom tick formatter that converts billions to a compact "B" label, and styling tick text and grid lines via CSS. An SVG renderer with D3 v6 handles the layout, including margins and descriptive axis titles.

AI-generated description

This bar chart shows population of the 10 most populous countries. The data comes from the year 2018 in United Nations World Population Prospects 2017

MIT Licensed

Similar vizzes