🌍 Public
Viewing a saved revision (read-only)
06e04a072b1f4f8fb69157653d0fffc0
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