标签:
首先看一下示例中类之间的关系:

1. ChartDemo这个类是整个应用程序的入口,运行之后的效果显示一个list.
2. IDemoChart接口,这个接口定义了三个方法,
getName()返回值是listitem上显示的标题;
getDesc()返回值是listitem上显示的描述内容.
excute(context)返回值是一个Intent,当点击listitem后跳转到此Intent.
3. AbstractDemoChart类是一个抽象类,实现接口IDemoChart接口,这个类中封装了构建DataSet和renderer的方法,目的快速构建我们的dataset和renderer.这个类具体提供了哪些方法呢?见下图.至于为什么要进行这样的封装看完4中ChartFactory.get***Intent()方法的参数类型后您就明白了.

AbstractChartDemo.java:
4. 其他的以*Chat结尾的类大都继承自AbstractDemoChart这个类实现了接口IDemoChart.我们可以重点看一下execute(context)方法,分析之后发现这个方法中构建Intent的步骤大同小异,第一步构建dataset,第二步构建renderer,第三步调用ChartFactory.get***Intent()方法或ChartFactory.get***View()方法,二者的区别在于一个返回Intent,这个intent可以启动一个特定的activity,另一个返回GraphicalView,对这个GraphicalView可以灵活设置也可以仅作为一部分显示在任何activity上.对于ChartFactory.get***Intent()上的参数activityTitle是指设置显示在activity上的标题.
| 
 条形图  | 
 static android.content.Intent  | 
 getBarChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer,BarChart.Type type)  | 
| 
 条形图  | 
 static android.content.Intent  | 
 getBarChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer,BarChart.Type type, java.lang.String activityTitle)  | 
| 
 条形图  | 
 static GraphicalView  | 
 getBarChartView(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer,BarChart.Type type)  | 
| 
 气泡图  | 
 static android.content.Intent  | 
 getBubbleChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)  | 
| 
 气泡图  | 
 static android.content.Intent  | 
 getBubbleChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, java.lang.String activityTitle)  | 
| 
 气泡图  | 
 static GraphicalView  | 
 getBubbleChartView(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)  | 
| 
 组合图  | 
 static android.content.Intent  | 
 getCombinedXYChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, java.lang.String[] types, java.lang.String activityTitle)  | 
| 
 组合图  | 
 static GraphicalView  | 
 getCombinedXYChartView(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, java.lang.String[] types)  | 
| 
 立方折线图  | 
 static GraphicalView  | 
 getCubeLineChartView(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, float smoothness)  | 
| 
 立方折线图  | 
 static android.content.Intent  | 
 getCubicLineChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, float smoothness)  | 
| 
 立方折线图  | 
 static android.content.Intent  | 
 getCubicLineChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, float smoothness, java.lang.String activityTitle)  | 
| 
 拨号盘  | 
 static android.content.Intent  | 
 getDialChartIntent(android.content.Context context,CategorySeries dataset, DialRenderer renderer, java.lang.String activityTitle)  | 
| 
 拨号盘  | 
 static GraphicalView  | 
 getDialChartView(android.content.Context context, CategorySeries dataset,DialRenderer renderer)  | 
| 
 圆环图  | 
 static android.content.Intent  | 
 getDoughnutChartIntent(android.content.Context context,MultipleCategorySeries dataset, DefaultRenderer renderer, java.lang.String activityTitle)  | 
| 
 圆环图  | 
 static GraphicalView  | 
 getDoughnutChartView(android.content.Context context,MultipleCategorySeries dataset, DefaultRenderer renderer)  | 
| 
 圆环图  | 
 static android.content.Intent  | 
 getLineChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)  | 
| 
 折线图  | 
 static android.content.Intent  | 
 getLineChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, java.lang.String activityTitle)  | 
| 
 折线图  | 
 static GraphicalView  | 
 getLineChartView(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)  | 
| 
 饼图  | 
 static android.content.Intent  | 
 getPieChartIntent(android.content.Context context, CategorySeries dataset,DefaultRenderer renderer, java.lang.String activityTitle)  | 
| 
 饼图  | 
 static GraphicalView  | 
 getPieChartView(android.content.Context context, CategorySeries dataset,DefaultRenderer renderer)  | 
| 
 范围条形图  | 
 static android.content.Intent  | 
 getRangeBarChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer,BarChart.Type type, java.lang.String activityTitle)  | 
| 
 范围条形图  | 
 static GraphicalView  | 
 getRangeBarChartView(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer,BarChart.Type type)  | 
| 
 散点图  | 
 static android.content.Intent  | 
 getScatterChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)  | 
| 
 散点图  | 
 static android.content.Intent  | 
 getScatterChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, java.lang.String activityTitle)  | 
| 
 散点图  | 
 static GraphicalView  | 
 getScatterChartView(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer)  | 
| 
 时间图  | 
 static android.content.Intent  | 
 getTimeChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, java.lang.String format)  | 
| 
 时间图  | 
 static android.content.Intent  | 
 getTimeChartIntent(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, java.lang.String format, java.lang.String activityTitle)  | 
| 
 时间图  | 
 static GraphicalView  | 
 getTimeChartView(android.content.Context context,XYMultipleSeriesDataset dataset, XYMultipleSeriesRenderer renderer, java.lang.String format)  | 
http://blog.csdn.net/lk_blog/article/details/7645509
安卓图表引擎AChartEngine(二) - 示例源码概述和分析
http://blog.csdn.net/lk_blog/article/details/7642751
安卓图表引擎AChartEngine(三) - 示例源码折线图、饼图和柱状图
http://blog.csdn.net/lk_blog/article/details/7645668
安卓图表引擎AChartEngine(四) - 源码示例嵌入Acitivity中的折线图
http://blog.csdn.net/lk_blog/article/details/7645665
安卓图表引擎AChartEngine(五) - Render和Dataset参数介绍
http://blog.csdn.net/lk_blog/article/details/7645661
安卓图表引擎AChartEngine(六) - 框架源码结构图
http://blog.csdn.net/lk_blog/article/details/7645671
安卓图表引擎AChartEngine(二) - 示例源码概述和分析
标签:
原文地址:http://www.cnblogs.com/senior-engineer/p/4984542.html