How to hide drawn values in MPAndroidChart?

If you want to hide values by condition, you can use a Formatter. Here is an example:

You have to call this method:

dataSet.setDrawValues(true)

and your have add a condition to your formatter:

public class MyYAxisValueFormatter implements IAxisValueFormatter {

    private DecimalFormat mFormat;

    public MyYAxisValueFormatter() {

        // format values to 1 decimal digit
        mFormat = new DecimalFormat("###,###,##0");
    }

    @Override
    public String getFormattedValue(float value, AxisBase axis) {
        String val = ""
        if ((int)value > 10){
            val = value
        }
        return mFormat.format(val);
    }

    /** this is only needed if numbers are returned, else return 0 */
    /*@Override
    public int getDecimalDigits() { return 1; }*/
}

If you want to hide all of the values you can use this:

dataSet.setDrawValues(false)

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.