欢迎来到天天文库
浏览记录
ID:34462660
大小:67.67 KB
页数:9页
时间:2019-03-06
《安卓图表引擎achartengine源码示例嵌入acitivity中的折线图》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、安卓图表引擎AChartEngine安卓图表引擎AChartEngine(四)-源码示例嵌入Acitivity中的折线图前面几篇博客中都是调用ChartFactory.get***Intent()方法,本节讲的内容调用ChartFactory.get***View()方法,这个方法调用的结果可以嵌入到任何一个Activity中,作为Activity的一部分。XYChartBuilder.java(源码分析见注释)[java]viewplaincopy1.package org.achartengine.chartdemo.dem
2、o.chart; 2. 9安卓图表引擎AChartEngine1.import java.io.File; 2.import java.io.FileOutputStream; 3. 4.import org.achartengine.ChartFactory; 5.import org.achartengine.GraphicalView; 6.import org.achartengine.chart.PointStyle; 7.import org.achartengine.chartdemo.demo.R
3、; 8.import org.achartengine.model.SeriesSelection; 9.import org.achartengine.model.XYMultipleSeriesDataset; 10.import org.achartengine.model.XYSeries; 11.import org.achartengine.renderer.XYMultipleSeriesRenderer; 12.import org.achartengine.renderer.XYSeriesRende
4、rer; 13.import org.achartengine.tools.PanListener; 14.import org.achartengine.tools.ZoomEvent; 15.import org.achartengine.tools.ZoomListener; 16. 17.import android.app.Activity; 18.import android.graphics.Bitmap; 19.import android.graphics.Bitmap.CompressForma
5、t; 20.import android.graphics.Color; 21.import android.os.Bundle; 22.import android.os.Environment; 23.import android.view.View; 24.import android.view.ViewGroup.LayoutParams; 25.import android.widget.Button; 26.import android.widget.EditText; 27.import andro
6、id.widget.LinearLayout; 28.import android.widget.Toast; 29. 30.public class XYChartBuilder extends Activity { 31. public static final String TYPE = "type"; 32. 33. private XYMultipleSeriesDataset mDataset = new XYMultipleSeriesDataset(); 34. 35. private XY
7、MultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer(); 36. 37. private XYSeries mCurrentSeries; 38. 39. private XYSeriesRenderer mCurrentRenderer; 40. 41. private String mDateFormat; 42. 9安卓图表引擎AChartEngine1. private Button mNewSeries; 2. 3.
8、 private Button mAdd; 4. 5. private EditText mX; 6. 7. private EditText mY; 8. 9. private GraphicalView mChartView; 10.
此文档下载收益归作者所有