Charts
Gradle Setup
Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
Step 2. Add the dependency
dependencies {
implementation 'com.github.asayushg:charts:1.0.1'
}
👀
Examples
📔
Documentation 1. Pie Chart
Add the PieChart View in your layout as:
Create a list of Slice with percentage and color and submit to PieChart view with border width and color as:
val list = ArrayList()
list.add(
PieChart.Slice(
percentage = 20f,
color = Color.RED
)
)
findViewById(R.id.pieChart).submitList(pieChartList = list, borderSize = 10f, borderColor = Color.GRAY)
Charts Available
- Pie Chart
- Doughnut Chart
- Bar Chart
- Line Chart
- Area Chart
- Scatter Plot