2

I have a graph view that draws a path to some points like this: enter image description here

now I want to fill the inner area of graph with a gradient color how can I achieve this ?

Thanks

Edit: @Lumis I added another closed path and set the shader and it was like this: enter image description here

but there is a gradient color in the outer area of the graph, how can I avoid this ?

Reno
  • 33,594
  • 11
  • 89
  • 102
Mina Wissa
  • 10,923
  • 13
  • 90
  • 158

2 Answers2

0

This should help you: How to fill a Path in Android with a linear gradient?

You may need to draw two paths one closed for gradient and another one on top with different color for the chart.

Community
  • 1
  • 1
Lumis
  • 21,517
  • 8
  • 63
  • 67
0

If you are having trouble filling a path with the color, this might be some help.

https://github.com/blessenm/LineChartDemo

But here the path is filled with a color. Combining this with the link lumis gave might help you on how to fill it with a gradient.

blessanm86
  • 31,439
  • 14
  • 68
  • 79