Jack D
Jack D

Reputation: 129

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.

Upvotes: 7

Views: 11530

Answers (1)

Muhammad Saad Rafique
Muhammad Saad Rafique

Reputation: 3189

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

chartView.notifyDataSetChanged();
chartView.invalidate();

Upvotes: 31

Related Questions