Axis Labels
✓ Published1🌍 Public
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 descriptionCredit to @curran
Adding labels to our X and Y axes with D3.
MIT Licensed