首页 > 代码库 > XCL-Charts画曲线图(CurveChart) 例2

XCL-Charts画曲线图(CurveChart) 例2

  另一个横向的曲线图(CurveChart)

    效果:

      

代码:

//图基类
				chart = new CurveChart();
				//图所占范围大小
				chart.setChartRange(0, 0, this.mScrWidth  , this.mScrHeight );
				
				//标签轴标签集合
				LinkedList<String> lables = new LinkedList<String>();
				lables.add("2010");
				lables.add("2011");
				lables.add("2012");
				lables.add("2013");
				lables.add("2014");
				chart.setLineLables(lables);
				
				//线1的数据集
				LinkedHashMap<Double,Double> linePoint1 = new LinkedHashMap<Double,Double>();
				linePoint1.put(10d, 30d);
				linePoint1.put(25d, 40d);
				linePoint1.put(60d, 35d);
				linePoint1.put(75d, 50d);
				CurveData curveData1 = new CurveData("青菜萝卜够吃",
						(int)Color.rgb(54, 141, 238) ,linePoint1);
				//线2的数据集
				LinkedHashMap<Double,Double> linePoint2 = new LinkedHashMap<Double,Double>();
				linePoint2.put(40d, 40d);
				linePoint2.put(55d, 55d);
				linePoint2.put(70d, 45d);
				linePoint2.put(85d, 25d);				
				CurveData curveData2 = new CurveData("饭管够",
						(int)Color.rgb(255, 165, 132) ,
						linePoint2,XTypes.LineDotStyle.Rect,(int)Color.rgb(234, 83, 71));
								
				//设定数据源
				LinkedList<CurveData> chartData = http://www.mamicode.com/new LinkedList();>

例子集中展示:  自己写的Android图表库XCL-Charts例子集中展示(会持续更新)


MAIL: xcl_168@aliyun.com

BLOG: http://blog.csdn.net/xcl168