Android图表生成类库:desCharts
jopen
10年前
desCharts是一个Android图表生成类库。 支持的包括XY图表、折线/曲线图、柱状图、堆叠柱状图、堆叠折线/曲线图、Styled XY图表。
<it.bradipao.lib.descharts.StyledXyChartView android:id="@+id/chart" android:layout_width="match_parent" android:layout_height="200dp" /> // create FIRST serie StyledChartPointSerie rr = new StyledChartPointSerie(2); rr.addPoint(new StyledChartPoint(-90, 99,0xff99cc00,0xffeeeeee)); rr.addPoint(new StyledChartPoint(-49, 80,0xffff4444,0xffffcccc)); rr.addPoint(new StyledChartPoint( -5,180,0xff99cc00,0xffeeff99)); rr.addPoint(new StyledChartPoint( 17, 99,0xffffbb33,0xffffee99)); rr.addPoint(new StyledChartPoint( 54, 80,0xff33bbee,0xffeeeeee)); rr.addPoint(new StyledChartPoint(125,120,0xff99cc00,0xffeeeeee)); rr.addPoint(new StyledChartPoint(158, 20,0xffff4444,0xffeeeeee)); rr.addPoint(new StyledChartPoint(209, 50,0xffff4444,0xffffcccc)); rr.addPoint(new StyledChartPoint(297,109,0xff33bbee,0xff99ddff)); // create SECOND serie StyledChartPointSerie gg = new StyledChartPointSerie(2); gg.addPoint(new StyledChartPoint( 17,-10,Color.BLACK,Color.TRANSPARENT,0xffff8800,5)); gg.addPoint(new StyledChartPoint( 54, 20,Color.BLACK,Color.TRANSPARENT,0xffcc0000,5)); gg.addPoint(new StyledChartPoint(125,-50,Color.BLACK,Color.TRANSPARENT,0xff669900,5)); gg.addPoint(new StyledChartPoint(158, 89,Color.BLACK,Color.TRANSPARENT,Color.GRAY,8)); gg.addPoint(new StyledChartPoint(209, 20,Color.BLACK,Color.TRANSPARENT,Color.GRAY,4)); gg.addPoint(new StyledChartPoint(217,Float.NaN,Color.BLACK,Color.TRANSPARENT,Color.GRAY,4)); gg.addPoint(new StyledChartPoint(250, 99,Color.BLACK,Color.TRANSPARENT,Color.GRAY,4)); gg.addPoint(new StyledChartPoint(261, 75,Color.BLACK,Color.TRANSPARENT,Color.GRAY,4)); gg.addPoint(new StyledChartPoint(295, 33,Color.BLACK,Color.TRANSPARENT,Color.GRAY,4)); // add lines to chart vChart.addSerie(rr); vChart.addSerie(gg);