Skip to main content
100%

Customizing Axes

✓ Published0🌍 Public
GGunMoLee
Last edited Feb 9, 2020
Created on Feb 9, 2020

This example presents a horizontal bar chart detailing the populations of the ten most populous countries. The chart emphasizes its custom axes: a bottom x-axis shows population figures, reformatted from thousands to billions using D3's `format` and a custom tick function, while the left y-axis displays country names with its domain and tick lines removed. The chart, rendered as SVG, uses `d3.scaleLinear`, `d3.scaleBand`, `d3.axisLeft`, and `d3.axisBottom` to construct the scales and axes. Data is loaded from a CSV file using `d3.csv`; grid lines are created by extending the x-axis ticks, and the chart is annotated with axis and title labels.

AI-generated description
MIT Licensed

Similar vizzes