I am using MPAndroidChart and I have two questions:
Update for version 3.0.0+
Formatting values is now done by extending the ValueFormatter
class and overriding the required methods for formatting. This is also where custom logic (e.g. only show labels for values > 10) can be inserted.
class MyValueFormatter : ValueFormatter() {
private val format = DecimalFormat("###,##0.0")
// override this for e.g. LineChart or ScatterChart
override fun getPointLabel(entry: Entry?): String {
return format.format(entry?.y)
}
}
More examples and a detailed explanation can be found in the new documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With