This variation of a line chart demonstrates how to use a linear gradient as a quantitative color encoding redundant with y-position. The gradient units are defined as userSpaceOnUse, such that the gradient stops can be positioned explicitly rather than based on the line’s bounding box.
forked from mbostock's block: Gradient Encoding
https://d3js.org/d3.v3.min.js