esnet / react-timeseries-charts

Declarative and modular timeseries charting components for React
http://software.es.net/react-timeseries-charts
Other
865 stars 283 forks source link

Gradient color on LineCharts #98

Open primozs opened 8 years ago

primozs commented 8 years ago

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

pjm17971 commented 8 years ago

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

jtiscione commented 4 years ago

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.