Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Customizing Axes

Public visualization

Viewing a saved revision (read-only)

06e04a072b1f4f8fb69157653d0fffc0

Customizing Axes

0 stars1🌍 Public
LLonwabo11
Last edited May 6, 2019
Created on May 3, 2019
Forked from Customizing Axes

This horizontal bar chart shows the populations of nine countries, ordered by country name and scaled linearly by population. The example demonstrates how to customize axis ticks, converting the default numeric labels from billions to abbreviated values with the suffix 'B'. Built with D3 v5, the code uses `d3.scaleBand` and `d3.scaleLinear` to map data, and `d3.axisLeft` and `d3.axisBottom` to render the axes. The `axisBottom` is formatted using `d3.format` with a custom replacement to display values in billions. The data is loaded from a CSV file and rendered in an SVG.

AI-generated description