Is there a good way of dynamically displaying graphs in an Android application. Is there a tool for it?
-
1Duplicate question http://stackoverflow.com/questions/424752/any-good-graphing-packages-for-android – Will Kru Jul 24 '11 at 12:12
-
Simple example here http://stackoverflow.com/questions/26543739/how-to-draw-a-graph-in-android-using-graphview/26562713#26562713 – Nabin Oct 30 '14 at 13:38
-
Try to use this one https://github.com/PhilJay/MPAndroidChart :) – Fran Ceriu Oct 20 '15 at 06:39
3 Answers
There are many opinions to do graphing. If you want static graphing you can use these API's/code samples.
- AChartEngine
- Draw a Graph
- Charts4j
- AndroidPlot - one of the best looking ones, does dynamic plots too and is now open sourced.
- TeeChart
So many others to choose from but most are static and non of these can handle real time data plots, i.e. ECG wave forms. One example you might want to look at is the Tricorder android example. Problem it is really complex to setup and if you just want the graphs, there is so much code to rip out. It can be done but I even noticed there is a lag the longer you run the program.
So far the only way I have found a real good dynamic graphing, is to do it yourself and use the SurfaceView and then draw usin the path.lineTo() see below for previous SO answer for this solution.
-
thanks..I tried SOEg. but data overlapping on each other..instead to move further...any suggestion? – CoDe Dec 09 '13 at 10:39
-
See these http://stackoverflow.com/a/8579577/346309 http://stackoverflow.com/q/7235326/346309 I do have some source code that might help but the best way is the SO example if you are doing dynamic plotting. – JPM Dec 09 '13 at 17:12
-
Minor correction: Androidplot has always supported plotting realtime data. See the OrientationSensorExample in the [Androidplot demo app](https://play.google.com/store/apps/details?id=com.androidplot.demos&hl=en) on the Play Store if you want to see it live on your device. – Nick Jan 30 '16 at 05:45
-
Do you see then this was written? 5 years ago, androidplot was in its childhood and still does not handle the amount of data say a heart monitor uses that I was coding for. Data points at 256 per sec the graphing of androidplot died on the vine with this. I eventually came up with my own graphing system. But yes statically yours is great dynamically its still a little weak. – JPM Feb 01 '16 at 22:23
-
1It seems that 3 years later - only https://github.com/PhilJay/MPAndroidChart is available. All alternatives described here are no longer maintained. – elcuco Mar 15 '16 at 09:35
-
Actually andriodplot still is maintained but now its at https://bitbucket.org/androidplot/androidplot/ last commit was jan 2016 – JPM Mar 16 '16 at 19:10
Try GraphView https://www.youtube.com/watch?v=lokgFp9h85o I used these video series on GraphView to plot real time graph from data coming from adruino .

- 133
- 9
I use the library MPAndroidChart (https://github.com/PhilJay/MPAndroidChart), is the best library for this kind of things in Android.

- 440
- 6
- 9