Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/222.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 找不到MPAndroidChart错误类ValueFormatter_Java_Android_Android Studio - Fatal编程技术网

Java 找不到MPAndroidChart错误类ValueFormatter

Java 找不到MPAndroidChart错误类ValueFormatter,java,android,android-studio,Java,Android,Android Studio,将项目中的MPAndroidChart库从'com.github.PhilJay:MPAndroidChart:v2.25更新到'com.github.PhilJay:MPAndroidChart:v3.0.2后,出现一个错误,表明找不到类ValueFormatter。在进一步的研究中,似乎有人在maven repository artefact index上犯了一个错误,因为v2.2.5似乎是最新版本,而v3.0.2不是最新更新的版本我目前正在一个工作项目中使用此版本 implementati

将项目中的MPAndroidChart库从'com.github.PhilJay:MPAndroidChart:v2.25更新到'com.github.PhilJay:MPAndroidChart:v3.0.2后,出现一个错误,表明找不到类ValueFormatter。在进一步的研究中,似乎有人在maven repository artefact index上犯了一个错误,因为v2.2.5似乎是最新版本,而v3.0.2不是最新更新的版本

我目前正在一个工作项目中使用此版本

implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
对于X和Y的格式,我使用以下导入

import com.github.mikephil.charting.formatter.IAxisValueFormatter;
import com.github.mikephil.charting.formatter.IValueFormatter;
实现看起来像这样

public class MyValueFormatter implements IValueFormatter {

    private DecimalFormat mFormat;

    public MyValueFormatter() {
        mFormat = new DecimalFormat("###,###,##0"); // use one decimal
    }

    @Override
    public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
        // write your logic here
        return mFormat.format(value) + ""; // e.g. append a dollar-sign
    }
}

我目前正在工作项目中使用此版本

implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
对于X和Y的格式,我使用以下导入

import com.github.mikephil.charting.formatter.IAxisValueFormatter;
import com.github.mikephil.charting.formatter.IValueFormatter;
实现看起来像这样

public class MyValueFormatter implements IValueFormatter {

    private DecimalFormat mFormat;

    public MyValueFormatter() {
        mFormat = new DecimalFormat("###,###,##0"); // use one decimal
    }

    @Override
    public String getFormattedValue(float value, Entry entry, int dataSetIndex, ViewPortHandler viewPortHandler) {
        // write your logic here
        return mFormat.format(value) + ""; // e.g. append a dollar-sign
    }
}