I have tried rounding the corners of the pie chart and trying to reduce the size of the light part slightly, with no success at all. If anyone knows how to do it, I would be very grateful.
This is what I did:
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
//declare a function for pie chart activity
setUpSelectionPieChart()
}
private fun setUpSelectionPieChart() {
//Create a dataset
val dataArray = ArrayList<PieEntry>()
dataArray.add(PieEntry(38f))
dataArray.add(PieEntry(14f))
dataArray.add(PieEntry(14f))
dataArray.add(PieEntry(34f))
val dataSet = PieDataSet(dataArray, "")
dataSet.valueTextSize=20f
dataSet.valueTextColor=Color.WHITE
//Color set for the chart
val colorSet = java.util.ArrayList<Int>()
colorSet.add(Color.rgb(255,107,107)) //red
colorSet.add(Color.rgb(173,232,244)) // blue
colorSet.add(Color.rgb(216,243,220)) // green
colorSet.add(Color.rgb(255,230,109)) // Yellow
dataSet.setColors(colorSet)
dataSet.sliceSpace = 10F
val data = PieData(dataSet)
//Personal Configuration
pieChart.transparentCircleRadius = 95F
pieChart.isRotationEnabled = false
pieChart.setDrawRoundedSlices(false)
//chart description
pieChart.description.text = "Pie chart"
pieChart.description.textSize = 20f
//Chart data and other styling
pieChart.data = data
pieChart.centerTextRadiusPercent = 0f
pieChart.isDrawHoleEnabled = true
pieChart.legend.isEnabled = false
pieChart.description.isEnabled = false
}
This is what I want to have: