react-native-chart-kit icon indicating copy to clipboard operation
react-native-chart-kit copied to clipboard

Two-color gradient for fillShadowGradient in LineChart

Open ezrafree opened this issue 4 years ago • 1 comments

I currently am using the LineChart component to build out an area chart, for example:

image

However, I need the linear gradient of fillShadowGradient to fade from one color to another. I see in AbstractChart.tsx lines 479 through 484 that the <Stop> element is hard-coded to fade to 0.

Is there a way I can extend the class from AbstractChart in my own project and override the renderDefs() method with my own? And if so, are there any code examples of this anywhere? Thanks in advance!

ezrafree avatar May 27 '21 22:05 ezrafree

looking at example - backgroundGradientFrom: "#1E2923", backgroundGradientTo: "#08130D",

maybe this helps.

cn-johndpope avatar Jan 04 '24 04:01 cn-johndpope