Skip to main content
100%

Customizing axes

✓ Published0🌍 Public
AAnita Tse
Last edited Feb 7, 2020
Created on Feb 7, 2020
Forked from Making a Bar Chart

This example shows a horizontal bar chart of the top 10 most populous countries, using population data loaded from a CSV file. It customizes the axes by removing domain lines and tick lines from the y-axis, while the x-axis uses a custom tick format that abbreviates large numbers (e.g., converting billions to "B") via d3.format. The chart is rendered with SVG using d3.scaleBand for the categorical country labels and d3.scaleLinear for population values. Axis generation relies on d3.axisBottom and d3.axisLeft, with tick size extended across the plot for grid lines, and a title and axis label added as text elements.

AI-generated description
MIT Licensed

Similar vizzes