Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Axis Labels

Public visualization

Viewing a saved revision (read-only)

454c2a1bd0cf4d66b4a4a7d27325cd30

Fork of Axis Labels

0 stars1🌍 Public
JJingxuan Yang
Last edited Feb 6, 2024
Created on Feb 6, 2024
Forked from Axis Labels

This fork demonstrates how to add labeled axes to a scatterplot-style visualization using D3 v7. It renders a gray inner rectangle as the plotting area, with a linear x-axis and y-axis scaled from 0 to 100, and places the labels “X Axis Label” and “Y Axis Label” at configurable offsets. The code uses `scaleLinear`, `axisBottom`, and `axisLeft` to create the axes, while custom functions `xAxisLabel` and `yAxisLabel` position the text elements with SVG transforms.

AI-generated description

Adding labels to our X and Y axes with D3.