Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to refresh android mpchart graph without refreshing whole activity

Hello i am using android MPAndroidChart library in my project. I want to refresh chart without refreshing activity page.

Thanks in advance.

like image 525
Jack D Avatar asked Nov 28 '22 00:11

Jack D


1 Answers

Where ever upon button click or spinner selection you need to update your graph just call a method:

chartView.notifyDataSetChanged();
chartView.invalidate();
like image 84
Muhammad Saad Rafique Avatar answered May 15 '23 01:05

Muhammad Saad Rafique