MPAndroidChart
MPAndroidChart copied to clipboard
Shadow on LineChart
Hi plz check above image. i need to add shadow on line of LineChart. For that plz set some property for shadow for both android and ios.
mChart.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mChart.getRenderer().getPaintRender().setShadowLayer(3, 5, 3, Color.GRAY);
try above ?
Wow, awesome! @yanjf90 How did you figured it out btw?
How to add different shadow colors for 2 different datasets in one graph?
@nicatguliyev you can try to override drawLinear method and call setShadowLayer befor drawLines
mChart.setLayerType(View.LAYER_TYPE_SOFTWARE, null); mChart.getRenderer().getPaintRender().setShadowLayer(3, 5, 3, Color.GRAY);
try above ?
Thanks, Saved me. @yanjf90 : Can you please tell me, how to give gradient color in setShadowLayer()?
I made a custom renderer that supports shadow on top, bottom, both and shadow height. Spent like 7h to make everything work and now I see this.