Formatting axis
This example shows a horizontal bar chart of the top 10 most populous countries, with population values formatted using d3.format’s ".3s" abbreviation (e.g., 1.42M). The chart uses d3.scaleLinear for the x-axis, d3.scaleBand for the y-axis, and d3.axisBottom with a custom tickFormat to display compact population labels. Data is loaded from a CSV file via d3.csv, and the SVG rendering is driven by React-compatible D3 v7 code. Axis gridlines are removed, and a text label for the x-axis appears below the ticks.