Customize Axes
✓ Published2🌍 Public
This example shows a horizontal bar chart ranking the top 10 most populous countries, with population values formatted in billions using a custom tick formatter that replaces 'G' with 'B'. The chart uses d3.scaleBand for the categorical y-axis and d3.scaleLinear for the quantitative x-axis, with axes rendered via d3.axisLeft and d3.axisBottom. Gridlines extend from the x-axis ticks across the plot, and the y-axis domain lines are removed for a cleaner look. Data loads from a CSV file and is parsed with d3.csv, while SVG rendering and styling are handled through D3 selections and CSS classes.
AI-generated descriptionMIT Licensed