Skip to main content
100%

Axis Labels

✓ Published1🌍 Public
JJacob Chlebowski
Last edited Sep 14, 2024
Created on Sep 14, 2024
Forked from Axis Labels

This example demonstrates how to add clear, readable labels to the X and Y axes of a D3 chart. A gray rectangular plotting area is drawn, with linear scales mapping 0–100 values to pixel coordinates. The X-axis label is positioned below the axis at the horizontal center, while the Y-axis label is rotated 90 degrees and centered vertically. The code uses d3.select, scaleLinear, axisBottom, and axisLeft to construct the visualization, with text elements styled via font-family attributes.

AI-generated description

Credit to @curran

Adding labels to our X and Y axes with D3.

MIT Licensed

Similar vizzes