Skip to main content
100%

Customizing Axes

✓ Published1🌍 Public
Jjkmingwen
Last edited Mar 9, 2021
Created on Mar 9, 2021
Forked from Making a Bar Chart

This example demonstrates a horizontal bar chart of the ten most populous countries, using a linear scale for population and a band scale for country names. It customizes the axes by removing the default axis lines, styling tick marks with a light gray color, and adding a formatted "Population" label using a custom tick format that abbreviates large numbers with "B" for billions. The left axis displays country names without tick lines, while the title sits above the plot. The code relies on D3 v6's `scaleLinear`, `scaleBand`, `axisBottom`, `axisLeft`, and `format` functions, rendering to an SVG canvas.

AI-generated description
MIT Licensed

Similar vizzes