Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/erenalpaslan/chartcore

Data visualization library 📊 for Android. Based on Chart.js javascript library which is currently the most popular library for web development. Extremely customizable, supports pie, doughnut, line, bar, radar, area, bubble, scatter and mixed types.
https://github.com/erenalpaslan/chartcore

android android-library bar-chart chart chart-library chartjs graphics kotlin line-chart pie-chart visualization webview

Last synced: 3 months ago
JSON representation

Data visualization library 📊 for Android. Based on Chart.js javascript library which is currently the most popular library for web development. Extremely customizable, supports pie, doughnut, line, bar, radar, area, bubble, scatter and mixed types.

Awesome Lists containing this project

README

        

[![Android CI](https://github.com/ErenAlpaslan/ChartCore/actions/workflows/maven-publish.yml/badge.svg)](https://github.com/ErenAlpaslan/ChartCore/actions/workflows/maven-publish.yml)

## ChartCore
Data visualization library 📊 for Android. Based on Chart.js javascript library which is currently the most popular library for web development. Extremely customizable, supports pie, doughnut, line, bar, radar, area, bubble, scatter and mixed types.

***
## Features

1. Support `Android`、`Kotlin` & `Java`.
2. Supports pie, doughnut, line, bar, radar, area, bubble, scatter and mixed types of chart
3. Interactive、animated, the `animation` effect is exquisite 、delicate、 smooth and beautiful.[Underdevelopment]
4. Support `chain programming syntax` like system framework.

***
## Installation
[![](https://jitpack.io/v/ErenAlpaslan/ChartCore.svg)](https://jitpack.io/#ErenAlpaslan/ChartCore)

### Gradle
#### Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

```groovy
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
```

#### Step 2. Add the dependency

```groovy
dependencies {
implementation 'com.github.ErenAlpaslan:ChartCore:1.0.0'
}
```

## Usage

1. Create the instance object of chart view:`ChartCoreView`
```xml

```
2. Configure the properties of chart model:`ChartCoreModel`
```kotlin
val data = mapOf(
"2019" to 60.0,
"2020" to 50.0,
"2021" to 40.0,
"2022" to 120.0,
"2023" to 10.0
)

val coreData = ChartData()
.addDataset(
ChartNumberDataset()
.data(data.values.toList())
.label("Acquisitions by year")
.offset(10)
)
.labels(data.keys.toList())

val chartOptions = ChartOptions()
.plugin(
Plugin()
.subtitle(
Title()
.display(true)
.text("Subtitle example")
.position(Position.BOTTOM)
).title(
Title()
.display(true)
.text("Title")
.position(Position.TOP)
.align(TextAlign.CENTER)
.color("red")
)
.tooltip(
Tooltip(false)
)
)
.elements(
Elements()
.line(
Line()
.tension(0.5f)
)
)

val chartModel = ChartCoreModel()
.type(ChartTypes.LINE)
.data(coreData)
.options(chartOptions)
```
3. And you need to set core model to view:

```kotlin
binding.chartCore.draw(chartModel)
```

4. 🚀 And thats it.
image

## LICENSE

image

ChartCore is available under the Apache license. See the [LICENSE](https://github.com/ErenAlpaslan/ChartCore/blob/master/LICENSE) file for more information.