Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Axis Labels

Public visualization

Viewing a saved revision (read-only)

947683e446884d229898fe7aed5f616c

Fork of Axis Labels

0 stars0🌍 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.