Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

D3 Axes - Configuration

Public visualization

D3 Axes - Configuration

0 stars1🌍 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()

Comments

Sign in to join the discussion.

MIT Licensed