How to draw a line graph in Android?

I want to draw a line graph that is updated in real time, like the graph we see in the Windows Task Manager when we want to take a look at CPU and memory usage over time.

Is there already an Android library that will allow me to do this easily? Or should I write my own? (And if I need to do this, how could I create some kind of canvas in Android activity?)

+4
source share
3 answers

I do not know the library designed for this, and I assume that you will have to draw it yourself.

This example in the Demos API project uses built-in sensors to draw the current graph on the canvas, it looks like you are trying to recreate, but replace the sensor input with a data feed or something else.

+1
source

Please take a look at AChartEngine. We use it in many Android projects, and it's great. It is free, it is still under development (new features), and the author is very useful.

http://www.achartengine.org/

+1
source

Have you looked at http://www.artfulbits.com/products/android/aicharts.aspx ? The library is quite large, but it may work for you.

0
source

All Articles