How to hide drawn values in MPAndroidChart?

vaibhav picture vaibhav · Jun 10, 2015 · Viewed 18.9k times · Source

I need to hide the value above bars in MPAndroidChart for barchart. I have tried all the methods available in it , but could not find the solution.

Answer

Philipp Jahoda picture Philipp Jahoda · Jun 10, 2015

Try dataSet.setDrawValues(false). This will prevent any values from being drawn.

In case you want to alter (customise) the drawn values (or only individual values), you can use the ValueFormatter interface and implement your own logic (e.g. hide specific values based on a condition). Always keep in mind performance is critical when using the ValueFormatter.