kibibyte
kibibyte

Reputation: 3037

How do I draw a line graph in Android?

I want to draw a line graph that updates in real time, similar to 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 a library designed for Android that will allow me to do this easily? Or will I have to write my own? (And if I do have to do this, how would I bring up some sort of canvas on an Android activity?)

Upvotes: 4

Views: 6367

Answers (3)

Harald Wilhelm
Harald Wilhelm

Reputation: 6716

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

http://www.achartengine.org/

Upvotes: 1

user806821
user806821

Reputation: 37

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

Upvotes: 0

Patrick Kafka
Patrick Kafka

Reputation: 9892

I don't know of a library designed for this and my guess is you would have to draw it yourself.

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

Upvotes: 1

Related Questions