Skip to main content
100%

customizing axis

✓ Published1🌍 Public
AAkash
Last edited Apr 22, 2022
Created on Mar 23, 2022
Forked from Making bar chat

This example shows a horizontal bar chart of population by country, with a customized x-axis that reformats large numeric values from scientific notation to abbreviated text (e.g., "1.44B" instead of "1.44G"). Using D3 v7, it loads data from a CSV file and maps population to a linear scale and country names to a band scale for the bars. The axes are generated with `axisLeft` and `axisBottom`, while the tick formatter uses `d3.format` with string replacement. Bars are drawn as SVG rectangles with heights derived from `yScale.bandwidth()`.

AI-generated description

An example including some commonly used features of SVG.

MIT Licensed

Similar vizzes