Skip to main content
100%

Percentage Change II

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Dec 14, 2015

This visualization depicts daily stock price changes as a percentage relative to the initial value, using a logarithmic y-axis to emphasize proportional shifts. A black line traces the full time series, while the area beneath it is filled with two distinct colors—green for periods above the baseline and purple for those below—achieved through clipping rectangles defined in SVG `<defs>`. The chart uses D3 v3’s `d3.svg.axis`, `d3.svg.line`, and `d3.svg.area` APIs, with data loaded via `d3.tsv` from a tab-separated file. Tick labels format the change as percentages, and the axis includes a subtle highlight for the zero-change tick.

AI-generated description

A variation of the percentage change example using clipping to apply different colors for positive change (green) and negative change (purple).

gpl-3.0 Licensed

Similar vizzes