September 30, 2020
Android Pie Chart library, supported with Kotlin DSL.
Installation
Step 1. Add the JitPack repository to your build file
allprojects { repositories { ... maven { url 'https://jitpack.io' } }}
Step 2. Add the dependency
dependencies { implementation 'com.github.furkanaskin:ClickablePieChart:1.0.6'}
Usage
val pieChart =PieChart( slices = provideSlices(), clickListener =null, sliceStartPoint =0f, sliceWidth =80f ).build() chart.setPieChart(pieChart)
Also you can use Kotlin DSL for building your chart.
val pieChartDSL = buildChart { slices { provideSlices() } sliceWidth { 80f } sliceStartPoint { 0f } clickListener { angle, index ->// ... } } chart.setPieChart(pieChartDSL)
To setup with legend you need an root layout for legend.
chart.showLegend(legendLayout)
XML Attributes
XML AttributeFormatDescriptionapp:popupTextstringShows text after the slice data value in popup.app:centerColorcolorCenter color of pie chart.app:showPopupbooleanShow popup when user clicks on pie chart.
Latest posts
April 11, 2021April 11, 2021April 11, 2021