Skip to main content
100%

Axis Component

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Aug 23, 2011

This interactive example showcases D3’s axis component, which simplifies adding reference lines and labels to custom visualizations. It plots S&P 500 monthly price data from 2000 to 2010 as a line with an area fill, using `d3.svg.axis` for both x- and y-axes. Clicking the chart triggers a random zoom on the x-axis, causing the ticks to smoothly transition via `svg.transition().duration(750)`. The visualization is rendered as SVG, with axes styled for crisp edges and clipped paths for the data series.

AI-generated description

This example demonstrates D3’s new axis component, which makes it easy to add reference lines and labels to a custom visualization. The axis component even supports automatic transitions! Click on the area to change the scale and watch as new ticks smoothly replace the old ones. Built with D3.

gpl-3.0 Licensed

Similar vizzes