Skip to main content
100%

customizing axes

✓ Published1🌍 Public
Ttheaddies
Last edited Feb 21, 2022
Created on Feb 21, 2022
Forked from Making a bar chart

This example shows a horizontal bar chart of the top 10 most populous countries, with custom axis styling. It uses d3.csv to load population data, d3.scaleBand for the categorical y-axis, and d3.scaleLinear for the numeric x-axis. The code removes default axis domains and gridlines via selections, applies custom tick formatting with `format('.3s')` to abbreviate large numbers, and adds axis titles and a graph title. All rendering is done with SVG elements, with bar colors and text styles defined in an external stylesheet.

AI-generated description
MIT Licensed

Similar vizzes