I am developing an app for health gadget and this point I need to be able to draw graphs. Data is continuously received via Bluetooth and the graph should look similar to cardiograph one with a continuous smooth update when new data is received. I found two libraries to tackle this issue (aChartEngine and GraphView). Could you please suggest what is the difference between them and when to use each of them?
-
http://stackoverflow.com/questions/26467376/android-charting-libraries – Angel Koh Jul 02 '15 at 01:18
1 Answers
Here is some very quick summary of 3 libraries I have tested to draw real-time graphs.
GraphView http://www.android-graphview.org/
Pros: Great for showing and updating multiple graphs in one view (tested up to 12 graphs). Great documentation. Definitely works fine for single graph in a view.
Cons: Limited styling options. Y-axis is neither scalable not scrollable. Very difficult to have X-axis as time (HH:MM:SS:SSS) updated real-time
MPAndroidChart https://github.com/PhilJay/MPAndroidChart
Pros: Great styling options. Easy to implement on tap listener. Real-time update is supported. Scalable and scrollable in all directions. Best to use for a single graph in a view. Pretty good documentation.
Cons: Much slower and consumer more memory than GraphView.
aChartEngine
Pros: powerful library with tons of options and good community.
Cons: real-time update is not really supported which means that one has to spend so good amount of time to get it work for real-time updates. Moreover, the documentation is limited though multiple examples can be traced online.

- 197
- 2
- 15
-
I found that GraphView, with 3 series, is fairly choppy... it's updated from data with 3 queue's every 80ms or so. Also, how is it possible to set the Y-axis label ? – Someone Somewhere Aug 04 '15 at 18:37
-
1There are 3 options: Automatic numbers Y-axis labeling - do not need to do anything. Static numbers: graph.getViewport().setYAxisBoundsManual(true); graph.getViewport().setMinY(3.5); graph.getViewport().setMaxY(8); and there is also setNumHorizontalLabels(5);. Static labels - refer http://www.android-graphview.org/documentation/category/labels-and-label-formatter – Alex Bailo Aug 05 '15 at 00:41