react-timeseries-charts icon indicating copy to clipboard operation
react-timeseries-charts copied to clipboard

Gradient color on LineCharts

Open primozs opened this issue 7 years ago • 2 comments

What would be the right approach to upgrade the LineChart with possibility to define gradient color like this: https://bl.ocks.org/mbostock/3969722 https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient

It seams gradient definition can be added anywhere so it would be interesting to modify LineChart or any other to accept two additional properties "colorGradient" default "linearGradient" and "colorGradientStops": PropType.array and render them in the LineChart grouping? Would you find this interesting to add with a pull request? Cheers

primozs avatar Nov 05 '16 17:11 primozs

I guess these could go into the style object, but it would have to be highly optional.

pjm17971 avatar Nov 07 '16 15:11 pjm17971

They can't go in the style object. The svg needs to have a defs section that includes the LinearGradient tag.

This library only supports solid colors.

jtiscione avatar Jan 21 '20 21:01 jtiscione