Skip to main content
100%

Customizing axes

✓ Published1🌍 Public
VVPTomi
Last edited Sep 1, 2020
Created on Sep 1, 2020

This example demonstrates how to customize chart axes in D3.js, displaying population data for seven countries as horizontal bars. The y-axis uses a band scale for country names, while the x-axis applies a linear scale with custom tick formatting that converts large numbers to compact notation (e.g., "2.2B"). The code employs scaleLinear, scaleBand, axisBottom, axisLeft, and format from D3 v5 within a React framework, rendering to SVG with custom tick text styling and axis label positioning.

AI-generated description

A bare minimum HTML page.

See also React Starter.

MIT Licensed

Similar vizzes