MPAndroidChart 4.0: the Android charting library rewritten in Kotlin, with a Compose module and new coordinates
GitHub describes it as A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.. The repository metadata lists Java as its primary language. The metadata lists the NOASSERTION license. This article stays within the project description and details documented in the GitHub repository README.
At a glance
- What is it?
- PhilJay/MPAndroidChart is an Apache-2.0 charting library for Android that has just been rewritten in Kotlin as version 4.0, adding a Jetpack Compose module and a property based API while the 3.x line stays buildable under its old coordinates.
- Who is it for?
- MPAndroidChart 4.0 is a reasonable pick for an Android app that needs interactive line, bar, pie, radar, bubble or candlestick charts, in Views or Compose, and can accept Java 17, Kotlin 2.0 and minSdk 23. It is a poor pick for iOS or web work, and a risky one if you intend to track the newest release, since 4.0 is a fresh rewrite.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 37 days ago.
- What is it written in?
- Mainly Java, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- PhilJay/MPAndroidChart38,187 ★ · -11
| Repository | 2026-08-13 | 2026-11-15 |
|---|---|---|
| PhilJay/MPAndroidChart | 38.2k | 38.2k |
-11 Stars in the last 94 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
4.0 has new coordinates, so the 3.x dependency line keeps building untouched
Version 4.0 is a rewrite in Kotlin, and its Maven coordinates differ from 3.x. The README states that a project on the 3.x coordinates com.github.PhilJay:MPAndroidChart keeps building untouched, and its advice for 4.0 is blunt: pin the version, do not track the newest one. The install block uses JitPack:
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
maven("https://jitpack.io")
}
}
// build.gradle.kts
dependencies {
implementation("com.github.PhilJay.MPAndroidChart:MPChartLib:v4.0.1")
implementation("com.github.PhilJay.MPAndroidChart:MPChartCompose:v4.0.1") // only for Compose
}The consequence is that upgrading is a deliberate edit of the coordinates, not a version bump. Nothing forces you off 3.x. Check that the string in your build file reads com.github.PhilJay.MPAndroidChart:MPChartLib for 4.0, with the dot between PhilJay and MPAndroidChart, and not the old com.github.PhilJay:MPAndroidChart form.
The Compose module pushes compileSdk to 37 while the core library needs only 35
The requirements are minSdk 23, compileSdk 35, Java 17 and Kotlin 2.0 or newer. The Compose module needs compileSdk 37, because Compose itself does. Java callers need no Kotlin at all.
So adding MPChartCompose is not free. If your app compiles against an older SDK level, taking the Compose artifact means raising compileSdk, and that can pull other parts of your build with it. Teams on Views can stay on MPChartLib and compileSdk 35. If you call the library from Java, you add no Kotlin sources, but the build toolchain still has to meet the stated Java 17 and Kotlin 2.0 versions.
The Compose API has one composable per chart type, configured once in setup
Every chart type has a composable with the same name. You pass data as state, configure the view once in setup, and read selection and the viewport back through the state object. The README example looks like this:
val state = rememberChartState()
LaunchedEffect(lineData) { state.animateX(500) }
LineChart(
data = lineData,
modifier = Modifier.fillMaxWidth().height(300.dp),
state = state,
marker = { entry, _ -> Text("${entry.y}") },
setup = {
description.isEnabled = false
axisRight.isEnabled = false
},
)The setup block runs once. ChartState exposes selectedEntry, the visible range and the zoom, and offers highlight, zoomIn, fitScreen, moveViewToX and the animate functions. Anything that has to change while the screen is showing therefore goes through the data you pass in or through the state functions, not through setup.
The Views API builds charts from entries, data sets and a data object
For classic Views, you place a chart in a layout and then give it data. Entries are points, a data set is one series with its styling, and the data object holds all series of a chart. Every chart type follows the same pattern, such as BarEntry into BarDataSet into BarData for a BarChart.
val entries = listOf(Entry(0f, 4f), Entry(1f, 8f), Entry(2f, 6f))
val set = LineDataSet(entries, "Sales").apply {
color = Color.BLUE
lineWidth = 2f
mode = LineDataSet.Mode.CUBIC_BEZIER
}
chart.data = LineData(set)
chart.animateX(500)Configuration happens through properties, and formatters and listeners are lambdas. Entries can carry your own object, so Entry(1f, 2f, data = order) is an Entry of Order, and the payload comes back typed from lookups and selections. To change data later you assign a new data object, or edit the entries and call chart.notifyDataSetChanged(), which also redraws.
Moving from 3.x is a migration with its own guide, not a drop-in swap
The project ships a MIGRATION.md and a longer migration guide on its documentation site, and a CHANGELOG.md that lists what changed in 4.0. The new API is described as property based, with lambdas for formatters and listeners, which differs from the getter and setter style that 3.x callers know.
Expect the move to be a code change in every file that touches a chart. Because the old coordinates keep building, you can migrate one screen at a time only if you keep both artifacts on the classpath, and running both together is something you should test before you plan on it. If your app is stable on 3.x and the charts do what you need, the lower risk path is to stay on the old line until a screen needs a Compose chart.
Version 4.0 is days old, and the performance claim has no figures attached
The recent releases are v4.0.1 on 2026-09-28, v4.0.0 on 2026-09-26 and v3.2.0, also on 2026-09-26, minutes before the 4.0.0 tag. The last push was on 2026-10-09 and the repository is not archived. So the rewrite is only weeks old, and a patch release followed it within two days.
The README's headline says thirty thousand points stay smooth, and the gallery section describes a twenty two second overview video showing thirty thousand points. No device, frame rate or memory figure is given, so the claim is the authors' statement and carries no measurement you can reproduce. Try your own data size on a low end phone you target before you commit. Treat early 4.0 versions as new code and watch the changelog for fixes.
Documentation spans 35 chapters, and usage questions belong on Stack Overflow
The guides at philjay.cc cover the library in 35 chapters, from a first chart to theming, Compose, custom renderers and troubleshooting. Every class, function and property has KDoc, and JitPack serves the generated API reference for each release, for both MPChartLib and MPChartCompose. To build the reference locally, run ./gradlew dokkaGenerate and open build/dokka/html/index.html. The MPChartExample module in the repository shows every chart type and feature plus Compose screens, and you open it in Android Studio and run it.
The issue tracker is for bugs and feature requests only. Usage questions go to Stack Overflow under the mpandroidchart tag. The library is Android only; the iOS counterpart is a separate project, Charts by danielgindi.
Editorial conclusion
MPAndroidChart 4.0 is a reasonable pick for an Android app that needs interactive line, bar, pie, radar, bubble or candlestick charts, in Views or Compose, and can accept Java 17, Kotlin 2.0 and minSdk 23. It is a poor pick for iOS or web work, and a risky one if you intend to track the newest release, since 4.0 is a fresh rewrite. Before adopting it, pin v4.0.1, read MIGRATION.md if you come from 3.x, and test your own data volume instead of trusting the thirty thousand point claim.
Frequently asked questions
How do I use MPAndroidChart in Android Studio?
Add the JitPack repository to settings.gradle.kts and the MPChartLib dependency, version v4.0.1, to build.gradle.kts. Then place a chart in a layout, build entries, a data set and a data object, and assign it to chart.data. The MPChartExample module shows every chart type.
What does MPAndroidChart 4.0 require?
minSdk 23, compileSdk 35, Java 17 and Kotlin 2.0 or newer. The Compose module needs compileSdk 37, and Java callers need no Kotlin.
Can I keep using MPAndroidChart 3.x after 4.0?
Yes. The 4.0 coordinates differ from 3.x, so a project on com.github.PhilJay:MPAndroidChart keeps building untouched. The project advises pinning the version and not tracking the newest one.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/philjay-mpandroidchart)Star history chart for your README
[](https://hysenlabs.com/projects/philjay-mpandroidchart)Was this useful?