🌍 Public
Viewing a saved revision (read-only)
3d91906aedd54b90bff0fbc2d62f0f68
Customizing Axes of Bar Chart
This example shows a horizontal bar chart ranking the top 10 most populous countries, drawn as SVG rectangles scaled by population values loaded from a CSV. It demonstrates customizing axes: the y-axis uses `d3.scaleBand` with tick lines removed, while the x-axis uses `d3.scaleLinear` with a `d3.axisBottom` that applies a custom tick formatter (converting abbreviations like “B” for billion) and negative tick sizes to create gridlines. The chart also adds axis labels and a title via SVG text elements, using D3 v5’s `select`, `csv`, and `scaleBand` APIs.
AI-generated description