开发者

How do I draw a line graph in Android?

I want to draw a line graph that up开发者_StackOverflowdates 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?)


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.


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/


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜