Skip to main content
100%

Fork of Axis Labels

✓ Published0🌍 Public
Llrsavoie@wpi.edu
Last edited Jan 30, 2024
Created on Jan 30, 2024
Forked from Axis Labels

This example demonstrates how to add labeled axes to a D3 visualization. It renders a gray inner rectangle with a linear x-scale and y-scale, then uses D3’s `axisBottom` and `axisLeft` to draw the axes. The x-axis label is centered horizontally, while the y-axis label is rotated -90 degrees and positioned along the left edge. The code relies on D3 v7 APIs such as `scaleLinear`, `select`, `join`, and `axisBottom`/`axisLeft`, with modular functions for each axis and label component.

AI-generated description

Adding labels to our X and Y axes with D3.

MIT Licensed

Similar vizzes