Skip to main content
100%

Segmented Lines

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jul 31, 2011

Four time series are drawn as thick segmented lines, each segment colored green, gray, or red based on its slope via a linear color scale from 0 to π. Circles mark every data point, while the y-axis is scaled to the maximum of all series, loaded from a local JSON file. The code uses d3.svg.line with segment arrays generated by a helper function, and applies stroke styling through d3.scale.linear and Math.atan2 on segment endpoints.

AI-generated description
gpl-3.0 Licensed

Similar vizzes