Android chart Class Library: William chart,

Source: Internet
Author: User

Android chart Class Library: William chart,

William chart is an Android chart class library based on Views. It helps developers implement line charts, bar charts, and Stacked column charts in Android applications. When the value changes, the chart also changes with the animation effect.

At the moment it provides:

  • LineChartView

  • BarChartView

  • StackBarChartView

Instructions for use:
To create a new chart, you must inherit the coordinate axes of the ChartView and implement some necessary methods. I think these methods are enough for you to draw any effect you want.
Xml file

 

?
12345678910111213141516171819 <com.db.chart.view.ChartView       xmlns:chart="http://schemas.android.com/apk/res-auto"       android: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"   />
?
123456789101112131415161718192021222324 // Customize labels   chart.setLabels(NONE/OUTSIDE/INSIDE)   chart.setLabelColor(color)   chart.setFontSize(integer)   chart.setTypeface(typeface)   // Define grid   chart.setGrid(paint)   chart.setHorizontalGrid(paint)   chart.setVerticalGrid(paint)   // Show threshold line   chart.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 set   chart.updateValues(int, array)   // Notify chart about updated values   chart.notifyDataUpdate()   // Tooltip support   chart.showTooltip(view)   chart.dismissTooltip(view)

LineChart(Use ellipsis for the same part as above)

?
123 <com.db.chart.LineChartView.../>
Java code:

 

?
12345678910111213141516171819 LineChartView chartView= new LineChartView()LineSet lineSet = new LineSet()lineSet.addPoint(new Point(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)

BarChart & StackBarChart

?
12345 <com.db.chart.BarChartView...chart:chart_barSpacing="dp"chart:chart_setSpacing="dp"/>

Java code

?
1234567891011 BarChartView chartView = new BarcChartView()barChart.setBarSpacing(dimen)barChart.setSetSpacing(dimen)barChart.setBarBackground(boolean)barChart.setBarBackgroundColor(color)barChart.setRoundCorners(dimen)BarSet barSet = new BarSet()Bar bar = new Bar(string, float)bar.setColor(color)barSet.addBar(bar)chartView.addData(barSet)

Listener settings

?
123456 chart.setOnEntryClickListener(new OnEntryClickListener(){     @Override     public void onClick(int setIndex, int entryIndex, Rect entryRect) {         //Do things     } });

Animation

?
123456789101112 Animation anim = new Animation()anim.setDuration(integer)anim.setEasing(easingFunction)anim.setEndAction(runnable)// Animation overlap between entriesanim.setOverlap(float)// Animation starting pointanim.setStartPoint(floatfloat)// Include alpha transitionanim.setAlpha(int)// Starts animationchart.animate(animation)

Project homepage:Http://www.open-open.com/lib/view/home/1413855326965

Diogobernardino/William amchartwatch1561 Fork295

Project Description:Android library to create charts.-view more...

 


Problem list:
#69 Set Dots missing By douglasd3Septem
#61 Not showing anything at all By Ph1b
#50 Can I set YAxis Label to right? By xu6148152
#29 Support CandleStickChart view By ArchinamonSeptem
#28 Consider support for pie charts By tuliohmendes2015-07-29
 

MasterBranch code updated on:

Development language: Java

ZIP file download

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.