Charts for Android

Android charting libraries

You can use MPAndroidChart.

It's native, free, easy to use, fast and reliable.

Core features, benefits:

  • LineChart, BarChart (vertical, horizontal, stacked, grouped), PieChart, ScatterChart, CandleStickChart (for financial data), RadarChart (spider web chart), BubbleChart
  • Combined Charts (e.g. lines and bars in one)
  • Scaling on both axes (with touch-gesture, axes separately or pinch-zoom)
  • Dragging / Panning (with touch-gesture)
  • Separate (dual) y-axes
  • Highlighting values (with customizeable popup-views)
  • Save chart to SD-Card (as image)
  • Predefined color templates
  • Legends (generated automatically, customizeable)
  • Customizeable Axes (both x- and y-axis)
  • Animations (build up animations, on both x- and y-axis)
  • Limit lines (providing additional information, maximums, ...)
  • Listeners for touch, gesture & selection callbacks
  • Fully customizeable (paints, typefaces, legends, colors, background, dashed lines, ...)
  • Realm.io mobile database support via MPAndroidChart-Realm library
  • Smooth rendering for up to 10.000 data points in Line- and BarChart
  • Lightweight (method count ~1.4K)
  • Available as .jar file (only 500kb in size)
  • Available as gradle dependency and via maven
  • Good documentation
  • Example Project (code for demo-application)
  • Google-PlayStore Demo Application
  • Widely used, great support on both GitHub and stackoverflow - mpandroidchart
  • Also available for iOS: Charts (API works the same way)
  • Also available for Xamarin: MPAndroidChart.Xamarin

Drawbacks:

  • No official support for dynamic & realtime data, limited performance in that area

Disclaimer: I am the developer of this library.

Charts for Android

To make reading of this page more valuable (for future search results) I made a list of libraries known to me.. As @CommonsWare mentioned there are super-similar questions/answers.. Anyway some libraries that can be used for making charts are:

Open Source:

  • AnyChart (Free for non-commercial, Paid for commercial)
  • MPAndroidChart
  • Holo Graph Library
  • aChartEngine
  • ChartView
  • aFreeChart
  • ChartDroid
  • charts4j
  • GraphView
  • AndroidPlot
  • Drawing the 3D piechart Using Google chart Api
  • WilliamChart
  • HelloCharts
  • ChartProgressBar
  • Plot.ly

Paid:

  • aiCharts
  • RChart (pre Honeycomb - Api 11 UI)
  • ShinobiControls **
  • Steema TeeChart **
  • Orson Charts (3D charts for Android)
  • Telerik Rad Chart
  • SciChart (Realtime Charts for Android)

** - means I didn't try those so I can't really recommend it but other users suggested it..

All Charts libraries for android does not work

this work for me

dependencies {

implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'

}


buildscript {
repositories {
google()
mavenCentral()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
classpath 'com.google.gms:google-services:4.3.5'

}
}

allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
maven {
url "https://s3.amazonaws.com/repo.commonsware.com"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

if not worked... check your internet connection and try another dependencies like retrofit to make sure your gradle sync work as well

React Native Charts for android

You should try using this library https://github.com/hongyin163/react-native-chart-android.
It does the job for Android.

Android AnyChart - Change Charts trigger by BottomNavigationView

Please, try to make the view active when the related chart is selected. Like this:

APIlib.getInstance().setActiveAnyChartView(anyChartView1);

This approach is used when multiple charts are required in a single layout.



Related Topics



Leave a reply



Submit