Skip to main content
100%

Customizing Axes

✓ Published0🌍 Public
JJovenne Naldrey Sapuay
Last edited Sep 4, 2019
Created on Sep 4, 2019
Forked from Customizing Axes

This example displays a horizontal bar chart ranking 15 countries by speed camera density, as sourced from a Spectator Index tweet. The chart uses D3 v5’s `scaleLinear` and `scaleBand` to map camera counts and country names, with `axisBottom` and `axisLeft` generating custom gridlines and ticks. Numerical labels are formatted using `d3.format` to abbreviate values, while the y-axis hides its domain and ticks for a cleaner look. SVG rectangles render the bars, with margins and axis titles controlled via CSS classes.

AI-generated description

Data on speed traffic cameras from this tweet.

MIT Licensed

Similar vizzes