Skip to content

Commit

Permalink
border
Browse files Browse the repository at this point in the history
  • Loading branch information
asayushg committed Oct 5, 2021
2 parents 47ac5cf + 2c7b53f commit e82ff9b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Charts
[![Release](https://img.shields.io/github/release/asayushg/charts.svg?style=flat)](https://jitpack.io/#asayushg/charts)
[![](https://www.jitpack.io/v/asayushg/charts.svg)](https://www.jitpack.io/#asayushg/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'
}

<h2 id="examples">Examples :eyes:</h2>

<img src="pie-chart-example.gif" width="250"/>

<h2 id="documentation">Documentation :notebook_with_decorative_cover:</h2>
<h4> 1. Pie Chart </h4>

Add the PieChart View in your layout as:
```
<saini.ayush.chart.PieChart
android:id="@+id/pieChart"
android:layout_width="125dp"
android:layout_height="125dp"
.../>
```

Create a list of Slice with percentage and color and submit to PieChart view with border width and color as:
```
val list = ArrayList<PieChart.Slice>()
list.add(
PieChart.Slice(
percentage = 20f,
color = Color.RED
)
)
findViewById<PieChart>(R.id.pieChart).submitList(pieChartList = list, borderSize = 10f, borderColor = Color.GRAY)
```

### Charts Available
- [x] Pie Chart
- [ ] Doughnut Chart
- [ ] Bar Chart
- [ ] Line Chart
- [ ] Area Chart
- [ ] Scatter Plot
Binary file added pie-chart-example.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e82ff9b

Please sign in to comment.