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.
- Support
Android
、Kotlin
&Java
. - Supports pie, doughnut, line, bar, radar, area, bubble, scatter and mixed types of chart
- Interactive、animated, the
animation
effect is exquisite 、delicate、 smooth and beautiful.[Underdevelopment] - Support
chain programming syntax
like system framework.
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
dependencies {
implementation 'com.github.ErenAlpaslan:ChartCore:1.0.0'
}
- Create the instance object of chart view:
ChartCoreView
<com.github.chartcore.view.ChartCoreView
android:id="@+id/chartCore"
android:layout_width="300dp"
android:layout_height="300dp" />
- Configure the properties of chart model:
ChartCoreModel
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)
- And you need to set core model to view:
binding.chartCore.draw(chartModel)
- 🚀 And thats it.
ChartCore is available under the Apache license. See the LICENSE file for more information.