Skip to main content
100%

D3 Axes - Configuration

✓ Published1🌍 Public
SSubhendu Karmakar
Last edited Dec 29, 2023
Created on Dec 29, 2023

This example demonstrates how to configure a D3 axis by explicitly setting tick values. A linear scale maps a domain of 0 to 100 to a range of 0 to 500 pixels, and an axis is generated using `d3.axisBottom(scale)`. The code calls `.tickValues([0, 25, 50, 75, 100])` to control which values appear as ticks, overriding the default tick generation. The axis is rendered into an SVG `<g>` element using `d3.select('svg g').call(axis)`, producing a clean, labeled horizontal axis.

AI-generated description

D3 Scales - scaleTime()

MIT Licensed

Similar vizzes