Skip to main content
100%

Customizing axes d3

✓ Published1🌍 Public
JJuanmaBV
Last edited Dec 30, 2022
Created on Dec 16, 2022
Forked from Bar chart d3

This example shows a horizontal bar chart ranking the ten most populous countries in 2018 by population. The chart uses D3.js v7's `scaleLinear` for the x-axis and `scaleBand` for the y-axis, with bars rendered as SVG `rect` elements. The x-axis employs `tickFormat` with the `.3s` format specifier, converting values into compact notation and replacing 'G' with 'B' for billions. Grid lines extend across the plot via `tickSize(-innerHeight)`, while the y-axis labels omit their domain line. Data comes from the World Population Prospects 2017 dataset, loaded as CSV with populations multiplied by 1000.

AI-generated description

Población de los 10 países más poblados del mundo. Año 2018. World Population Prospects 2017

MIT Licensed

Similar vizzes