安卓图表引擎AChartEngine(二) - 示例源码概述和分析

  • 2022-07-16 08:31:46

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

安卓图表引擎AChartEngine(二) - 示例源码概述和分析

1.ChartDemo这个类是整个应用程序的入口,运行之后的效果显示一个list.

2.IDemoChart接口,这个接口定义了三个方法,

getName()返回值是listitem上显示的标题;

getDesc()返回值是listitem上显示的描述内容.

excute(context)返回值是一个Intent,当点击listitem后跳转到此Intent.

3.AbstractDemoChart类是一个抽象类,实现接口IDemoChart接口,这个类中封装了构建DataSetrenderer的方法,目的快速构建我们的datasetrenderer.这个类具体提供了哪些方法呢?见下图.至于为什么要进行这样的封装看完4ChartFactory.get***Intent()方法的参数类型后您就明白了.

安卓图表引擎AChartEngine(二) - 示例源码概述和分析

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上的标题.

条形图

staticandroid.content.Intent

getBarChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer,BarChart.Typetype)

条形图

staticandroid.content.Intent

getBarChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer,BarChart.Typetype, java.lang.StringactivityTitle)

条形图

staticGraphicalView

getBarChartView(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer,BarChart.Typetype)

气泡图

staticandroid.content.Intent

getBubbleChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer)

气泡图

staticandroid.content.Intent

getBubbleChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, java.lang.StringactivityTitle)

气泡图

staticGraphicalView

getBubbleChartView(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer)

组合图

staticandroid.content.Intent

getCombinedXYChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, java.lang.String[]types, java.lang.StringactivityTitle)

组合图

staticGraphicalView

getCombinedXYChartView(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, java.lang.String[]types)

立方折线图

staticGraphicalView

getCubeLineChartView(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, floatsmoothness)

立方折线图

staticandroid.content.Intent

getCubicLineChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, floatsmoothness)

立方折线图

staticandroid.content.Intent

getCubicLineChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, floatsmoothness, java.lang.StringactivityTitle)

拨号盘

staticandroid.content.Intent

getDialChartIntent(android.content.Contextcontext,CategorySeriesdataset,DialRendererrenderer, java.lang.StringactivityTitle)

拨号盘

staticGraphicalView

getDialChartView(android.content.Contextcontext,CategorySeriesdataset,DialRendererrenderer)

圆环图

staticandroid.content.Intent

getDoughnutChartIntent(android.content.Contextcontext,MultipleCategorySeriesdataset,DefaultRendererrenderer, java.lang.StringactivityTitle)

圆环图

staticGraphicalView

getDoughnutChartView(android.content.Contextcontext,MultipleCategorySeriesdataset,DefaultRendererrenderer)

圆环图

staticandroid.content.Intent

getLineChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer)

折线图

staticandroid.content.Intent

getLineChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, java.lang.StringactivityTitle)

折线图

staticGraphicalView

getLineChartView(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer)

饼图

staticandroid.content.Intent

getPieChartIntent(android.content.Contextcontext,CategorySeriesdataset,DefaultRendererrenderer, java.lang.StringactivityTitle)

饼图

staticGraphicalView

getPieChartView(android.content.Contextcontext,CategorySeriesdataset,DefaultRendererrenderer)

范围条形图

staticandroid.content.Intent

getRangeBarChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer,BarChart.Typetype, java.lang.StringactivityTitle)

范围条形图

staticGraphicalView

getRangeBarChartView(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer,BarChart.Typetype)

散点图

staticandroid.content.Intent

getScatterChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer)

散点图

staticandroid.content.Intent

getScatterChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, java.lang.StringactivityTitle)

散点图

staticGraphicalView

getScatterChartView(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer)

时间图

staticandroid.content.Intent

getTimeChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, java.lang.Stringformat)

时间图

staticandroid.content.Intent

getTimeChartIntent(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, java.lang.Stringformat, java.lang.StringactivityTitle)

时间图

staticGraphicalView

getTimeChartView(android.content.Contextcontext,XYMultipleSeriesDatasetdataset,XYMultipleSeriesRendererrenderer, java.lang.Stringformat)

安卓图表引擎AChartEngine() -简介

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


猜你喜欢