- Java4Less ( http://java4less.com/charts/chart.php?info=android )      

- Chart4J (http://code.google.com/p/charts4j/)     需要网络支持

- BlueChart (http://code.google.com/p/bluechart/)

- aChartEngine (http://code.google.com/p/achartengine/)     

- aiCharts (http://www.artfulbits.com/Android/aiCharts.aspx)收费

- chartdroid(http://code.google.com/p/chartdroid/)

 



AChartEngine(简称ACE)是Google的一个开源图表库(for Android)。它功能强大,支持散点图、折线图、饼图、气泡图、柱状图、短棒图、仪表图等多种图表。

该项目地址位于:

http://code.google.com/p/achartengine/你可以选择合适的版本下载,每个版本都有一个jar包、实例源代码和java doc提供下载。当前最新版本为0.6。

需要注意的是,0.6版本不再支持Android 2.0以下(包含2.0)。也就是说如果你的目标平台使用了7以下SDK版本,比如Android 1.5-2.0。则需要下载老版本的ACE 0.5。


下面给出一个制作柱状图的例子:



String title = "**图表";
String xTitle = "x轴标题";

int[] colors = new int[] { Color.BLUE};
      XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
      renderer.setOrientation(Orientation.HORIZONTAL);
      setChartSettings(renderer, title, xTitle, "Y轴标题", 0,
          12, 0, 12, Color.GRAY, Color.LTGRAY);
      renderer.setXLabels(0);
int ySize = labels.size();
      Log.e("xp",String.valueOf(ySize));
      renderer.setYLabels(ySize);
for(int i = 1;i <= labels.size();i++){
       renderer.addTextLabel(i, labels.get(i-1));

      }
      renderer.setAxisTitleTextSize(16);
      renderer.setChartTitleTextSize(20);
      renderer.setLabelsTextSize(12);
      renderer.setLegendTextSize(15);
      renderer.setBarSpacing(0.6);//设置间距
      renderer.setMarginsColor(Color.WHITE);
      renderer.setBackgroundColor(Color.WHITE);
      renderer.setLabelsColor(Color.BLACK);
      renderer.setMargins(new int[] { 20, 40, 15, 10 });
      renderer.setPanEnabled(true, false); //x轴可拖动,Y轴不可
      renderer.setZoomEnabled(false, false);
      renderer.setDisplayChartValues(true);
return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer,
          Type.DEFAULT);



AChartEngine   is a charting library for Android applications. It currently supports the following chart types: 
line chart
area chart
scatter chart
time chart
bar chart
pie chart
bubble chart
doughnut chart
range (high-low) bar chart
dial chart / gauge
combined (any combination of line, cubic line, scatter, bar, range bar, bubble) chart
cubic line chart
All the above supported chart types can contain multiple series, can be displayed with the X axis horizontally (default) or vertically and support many other custom features. The charts can be built as a view that can be added to a view group or as an intent, such as it can be used to start an activity.
AChartEngine is currently at the 0.7.0 release. New chart types will be added in the following releases. Please keep sending your feedback such as we can continually improve this library.
Find us on Facebook, too: http://www.facebook.com/achartengine