I manually set DefaultValueFormatter(0) to a ChartData but still show 1 digital in DecimalFormat.
My solution as below for your reference:
step-1. in public void setData(T data) of MPChartLib\src\com\github\mikephil\charting\charts\Chart.java add a Disable flag to skip calling calculateFormatter(data.getYMin(), data.getYMax());
step-2. in MPChartLib\src\com\github\mikephil\charting\data\DataSet.java
public boolean needsDefaultFormatter() {
if (mValueFormatter == null)
return true;
//if (mValueFormatter instanceof DefaultValueFormatter) //ignore it for an unreasonable case
// return true;
return false;
}
Just use the formatter like it's supposed to be used: https://github.com/PhilJay/MPAndroidChart/wiki/The-ValueFormatter-interface
thank you so much.