WilliamChart图表库
                 MMM
                 10年前
            
                    介绍:
WilliamChart 是一个为安卓项目提供图表控件的开源库,他实现了数字的可视化,用作者的话说“我者喜欢看起来干净简单的图表,不想要那么多花哨的功能”。代码下载点这里:http://jcodecraeer.com/a/opensource/2014/1011/1738.html
  
 
  
  
运行效果:

使用说明:
创建一个新的chart需要继承自ChartView的坐标轴,同时实现一些必要的方法。我觉的这些方法足以让你绘制出任何你想要的效果。
  
xml
| 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19 </td> | </tr>  </tbody>  </table>  </div>  </div><com.db.chart.view.ChartViewandroid:layout_width="match_parent"android:layout_height="dp"...chart:chart_shadowDx="dp"chart:chart_shadowDy="dp"chart:chart_shadowRadius="dp"chart:chart_shadowColor="color"chart:chart_fontSize="dp"chart:chart_typeface="typeface"chart:chart_axisBorderSpacing="dp"chart:chart_axisThickness="dp"chart:chart_axisTopSpacing="dp"chart:chart_axisColor="color"chart:chart_axisX="boolean"chart:chart_label="boolean"chart:chart_labelColor="color"/> | 
| 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24 </td> | </tr>  </tbody>  </table>  </div>  </div>// Customize labelschart.setLabels(NONE/OUTSIDE/INSIDE)chart.setLabelColor(color)chart.setFontSize(integer)chart.setTypeface(typeface)// Define gridchart.setGrid(paint)chart.setHorizontalGrid(paint)chart.setVerticalGrid(paint)// Show threshold linechart.setThresholdLine(float, paint)chart.setMaxAxisValue(integer, integer)chart.setStep(integer)chart.setTopSpacing(dimen)chart.setBorderSpacing(dimen)chart.setAxisX(boolean)chart.show()// Update values of a given setchart.updateValues(int, array)// Notify chart about updated valueschart.notifyDataUpdate()// Tooltip supportchart.showTooltip(view)chart.dismissTooltip(view) | 
| 1  2  3 </td> | </tr>  </tbody>  </table>  </div>  </div><com.db.chart.LineChartView.../> | 
| 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19 </td> | </tr>  </tbody>  </table>  </div>  </div>LineChartView chartView= newLineChartView()LineSet lineSet = newLineSet()lineSet.addPoint(newPoint(string, float)// Style dotslineSet.setDots(boolean)lineSet.setDotsColor(color)lineSet.setDotsRadius(dimen)lineSet.setDotsStrokeThickness(dimen)lineSet.setDotsStrokeColor(color)// Style linelineSet.setLineThickness(dimen)lineSet.setLineColor(color)// Style background filllineSet.setFill(boolean)lineSet.setFillColor(color)// Style typelineSet.setDashed(boolean)lineSet.setSmooth(boolean)chartView.addData(lineSet) | 
| 1  2  3  4  5 </td> | </tr>  </tbody>  </table>  </div>  </div><com.db.chart.BarChartView...chart:chart_barSpacing="dp"chart:chart_setSpacing="dp"/> | 
| 1  2  3  4  5  6  7  8  9  10  11 </td> | </tr>  </tbody>  </table>  </div>  </div>BarChartView chartView = newBarcChartView()barChart.setBarSpacing(dimen)barChart.setSetSpacing(dimen)barChart.setBarBackground(boolean)barChart.setBarBackgroundColor(color)barChart.setRoundCorners(dimen)BarSet barSet = newBarSet()Bar bar = newBar(string, float)bar.setColor(color)barSet.addBar(bar)chartView.addData(barSet) | 
| 1  2  3  4  5  6 </td> | </tr>  </tbody>  </table>  </div>  </div>chart.setOnEntryClickListener(newOnEntryClickListener(){@Overridepublic void onClick(int setIndex, int entryIndex, Rect entryRect) {//Do things}}); | 
| 1  2  3  4  5  6  7  8  9  10  11  12 </td> | </tr>  </tbody>  </table>  </div>  </div>Animation anim = newAnimation()anim.setDuration(integer)anim.setEasing(easingFunction)anim.setEndAction(runnable)// Animation overlap between entriesanim.setOverlap(float)// Animation starting pointanim.setStartPoint(float, float)// Include alpha transitionanim.setAlpha(int)// Starts animationchart.animate(animation) |