Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MPAndroidChart pie chart animateY initial flickering

I've set up two pie charts with almost the exact same code.

In one implementation I've made mChart.animateX(1400); and in the other mChart.animateY(1400);

When using the animateY there is an initial flickering where we can see all the pie chart. This does not happen when using animateX

Here I have an video of the flickering. Video

I've tested in two devices. One running KitKat and the other Marshmallow. I'm fetching data from a server and adding the chart dinamicaly.

like image 250
Favolas Avatar asked Mar 18 '26 08:03

Favolas


1 Answers

Be sure not to set any default value to your chart before setting the values coming from server. It seems like you are trying to set data to your chart twice. So, this cause an interrupted animation from first data setting, as seen in the video.

like image 82
Ugurcan Yildirim Avatar answered Mar 19 '26 21:03

Ugurcan Yildirim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!