This post explains how to apply a color gradient to a line chart using d3.js. It relies on the linearGradient
svg element that allows to create a color gradient on a svg element.
linearGradient
to the svg
element. Read this page to understand how a color gradient works."url(#line-gradient)"
.