https://github.com/mancj/SlimChart
SlimChart is a light and easy to use chart library for Android.
https://github.com/mancj/SlimChart
Last synced: 16 days ago
JSON representation
SlimChart is a light and easy to use chart library for Android.
- Host: GitHub
- URL: https://github.com/mancj/SlimChart
- Owner: mancj
- Created: 2016-10-31T18:24:22.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-19T23:54:35.000Z (over 6 years ago)
- Last Synced: 2025-04-06T10:08:24.633Z (30 days ago)
- Language: Java
- Size: 2.12 MB
- Stars: 177
- Watchers: 7
- Forks: 24
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-github-android-ui - SlimChart - 轻量级便于使用的图表库 (图表(Chart))
README
![]()
# SlimChart
SlimChart is a light and easy to use chart library for Android.
Using SlimChart you will be able to create a stylish chart for your stats----------
![]()
![]()
## To get a SlimChart project into your build:
**Step 1.** Add it in your root build.gradle at the end of repositories:
```xml
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
```
**Step 2.** Add the dependency
```xml
dependencies {
compile 'com.github.mancj:SlimChart:0.1.2'
}
```## Usage examples
**xml:**
```xml```
**java:**
```java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);SlimChart slimChart = (SlimChart) findViewById(R.id.slimChart);
//Optional - create colors array
int[] colors = new int[4];
colors[0] = Color.rgb(46, 41,78);
colors[1] = Color.rgb(127, 22, 101);
colors[2] = Color.rgb(217, 3, 104);
colors[3] = Color.rgb(247, 76, 110);
slimChart.setColors(colors);//Create array for your stats
final float[] stats = new float[4];
stats[0] = 100;
stats[1] = 85;
stats[2] = 40;
stats[3] = 25;
slimChart.setStats(stats);//Play animation
slimChart.setStartAnimationDuration(2000);//Set single color - other colors will be generated automatically
slimChart.setColor(ContextCompat.getColor(this, R.color.colorPrimary));slimChart.setStrokeWidth(13);
slimChart.setText("234");
slimChart.setTextColor(Color.WHITE);
slimChart.setRoundEdges(true);
}
```