riku
2022-01-20 5a0fff8095cd5356f57c181b7e7b820e0f7efacf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package cn.flightfeather.thirdappmodule.util;
 
import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;
import com.github.mikephil.charting.formatter.IValueFormatter;
import com.github.mikephil.charting.utils.ViewPortHandler;
 
import java.text.DecimalFormat;
 
/**
 * Created by note_ff_1603 on 2017/8/10.
 */
 
public class MyBarValueFormatter implements IAxisValueFormatter,IValueFormatter {
 
    private DecimalFormat mFormat;
 
    public MyBarValueFormatter() {
        mFormat = new DecimalFormat("###,###,###,##0");
    }
 
    @Override
    public String getFormattedValue(float value, AxisBase axis) {
        return String.valueOf((int) value);
    }
 
    @Override
    public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
        return String.valueOf((int) value);
    }
}