Skip to main content
100%

Customizing Axes

✓ Published0🌍 Public
AAna
Last edited Oct 12, 2019
Created on Oct 12, 2019
Forked from Customizing Axes

This example presents a horizontal bar chart ranking the top 10 most populous countries (from a 2018 UN World Population Prospects estimate) by their population. The visualization stands out through its custom axes: the y-axis strips away default domain lines and tick lines, while the x-axis uses a custom tick format (d3.format('.2s')) and extends grid lines across the plotting area. Built with d3.v5, the code uses `scaleLinear` and `scaleBand` to map data to coordinates, `axisLeft` and `axisBottom` to generate axes, and SVG for rendering, with extensive styling applied via 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