Open tommasobo opened 5 years ago
Cannot find simple and short solution for this bug so I fix it simple overriding ValueFormatter.
class CustomPieNumberFormatter(var pieChart: PieChart?) : PercentFormatter(pieChart) {
val OVERLAP_LIMIT = 3.5
override fun getPieLabel(value: Float, pieEntry: PieEntry?): String {
return if (pieChart != null && pieChart!!.isUsePercentValuesEnabled) {
if (value < OVERLAP_LIMIT)
""
else
getFormattedValue(value)
} else {
// raw value, skip percent sign
mFormat.format(value.toDouble())
}
}
}
How can I hide small values in a PieChart if I am printing them outside the graph? I can get the label to be empty with a ValueFormatter but I can't understand how I would delete the line going outside the graph.
This is my current situation (without the Value Formatter to hide small values): https://i.imgur.com/CbGjGZZ.png