Skip to main content
100%

customzing axes

✓ Published1🌍 Public
Zzhangfa
Last edited Jul 30, 2020
Created on Jul 29, 2020
Forked from making a bar chart

This example visualizes the population of nine countries as horizontal bars, ranked from most to least populous, with a title and axis label. The chart uses D3 v5 with `csv` to load data, `scaleLinear` for the x-axis, `scaleBand` for the y-axis, and custom tick formatting to abbreviate population numbers with `format('.3s')`, converting “G” to “B”. Axes are configured with `axisBottom` and `axisLeft`, while the grid lines and labels are styled via SVG attributes and CSS. The data is multiplied by 1000 in `forEach` to match actual population figures.

AI-generated description
MIT Licensed

Similar vizzes