Start a Project

Using MPandroidChart Library for rendering graphs

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 :

 

 

That’s all folks. Stay Updated.

 

Exit mobile version