Using MPandroidChart Library for rendering graphs

Updated 14 December 2016

Save

Hello Fellas, We all know andorid till date don’t provide any graph view. That’s is why we are here.

There are many library available by various contributor all over the world. Some reputated one’s are:

i. PhilJay/MPAndroidChart

ii. http://www.android-graphview.org/

iii. aChartEngine

 

This blog is based on MPAndroidChart library. Here are the steps to create a simple graph (a curved or line graph).

 

Step1. Add dependency in module level gradle aka build.gradle

Step2. Add custom type of Chart provided by library.

note: we are using LineChart for the same of simplicity.

 

Step3. Configure your Chart View that was defined in step 2.

MPAndroidChart provide getter setter for the basic view as well changes that we want to reflect in graph view.

Here is our sample configuration.

 

Some cooked code for createData(count)

 

Here is our sample creation :

giphy (1)

 

 

That’s all folks. Stay Updated.

 

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home