Reputation: 23
Can anyone explain with a simple example on how to add the data dynamically to the chart which is already drawn. I tried with the details in the github link to add the data, but couldn't do so. A very short example or link is also fine. Thanks
Upvotes: 0
Views: 3728
Reputation: 2555
You can download the project here https://github.com/PhilJay/MPAndroidChart/archive/master.zip Open the project, and in MPChartExample, you have the file DynamicalAddingActivity.java.
/** each 5 seconds **/ new CountDownTimer(5000, 1000) { public void onTick(long millisUntilFinished) { } public void onFinish() { double randomValue = 19.0 + (Math.random() * (21.0 - 19.0)); int indexOfMyLine = 0; Entry newEntry = new Entry((float) randomValue, indexOfMyLine); }
}.start();
Upvotes: 1