customizing axes
✓ Published5🌍 Public
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 descriptionThis 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