开发者

How to fill a path with gradient

I have a graph view that draws a path to some points like this:

 How to fill a path with gradient

now I want to fill the inner area of graph with a gr开发者_开发技巧adient color how can I achieve this ?

Thanks

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

 How to fill a path with gradient

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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜