How to show pie chart in android

2020-07-06 05:20发布

问题:

I want to build an app in where I want to show memory and cpu usage map in a pie chart . However I have no idea about how to implement this .

I have seen the following question :

How to display the 3D pie chart asynchronously in android?

But I could not resolve this issue . What can I do ? Guys , can u help me in this regard ?

回答1:

To "paint" a graph on android you can use a third-party-lib. All libs supports different types of charts.

There are some graph-libs for Android:

  1. afreechart is based on jfreechart. License: LGPL Version: 0.0.4

  2. AChartEngine
    License: Apache Version: 1.2.0 Maven: yes. (custom repo?)

  3. AndroidPlot License: Apache Version: 0.6.0 Maven: yes

  4. GraphView
    License: Apache? Version: ? Maven: ?

I've found not so much about it. But it seems to be free.

  1. DroidCharts License: LGPL Version: r2? Maven: ?

  2. Chartdroid
    License: Apache Version: 2.0.0 Maven: ?

Or you implements your own :) It's not the perferct answer, but maybe a good hint.



回答2:

you can use achartengine to create different kinds of charts. For example you can find lots of links like these two

link1, link2

here is another nice example you can look at