Reputation: 57
I know there is the way to off (or hide) this inner labels in pieChart elements (circled in the image)! pieChart inner label image I try (all pieChart methods responsible for this i found in my opinion):
pieChart.drawEntryLabelsEnabled = false
pieChart.entryLabelColor = UIColor.clear
pieChart.drawCenterTextEnabled = false
But still labels are visible...
Upvotes: 1
Views: 1370
Reputation: 354
So you're trying to hide "value" label. And for that, you need to set drawValuesEnabled = false for your dataset.
I think "value label" is being mixed up with "entry label" and "center text", so check out the image for your better understanding.
// label inside the circle
pieChart.centerText = "center text"
// dataset for the pie chart
let data = PieChartDataSet(entries: [
PieChartDataEntry(value: 100, label: "entry label")
])
// hides entry label
pieChart.drawEntryLabelsEnabled = false
// set clear color for entry label = hides entry label
pieChart.entryLabelColor = .clear
// hides center text
pieChart.drawCenterTextEnabled = false
// hides value label
data.drawValuesEnabled = false
pieChart.data = PieChartData(dataSet: data)
Upvotes: 3