首页 > 解决方案 > 如何在 MPAndroidChart 条形图中的 yAxis 上绘制自定义值?

问题描述

我想在 Barchart 中的 yAxis 上显示我自己的值,我写了一个代码片段(值格式化程序),但是当我使用它时应用程序崩溃了,

public class YAixsFormatter implements IAxisValueFormatter
{
    List<String> time;

    public YAixsFormatter(List<String> time) {
        this.time = time;
    }

    @Override
    public String getFormattedValue(float value, AxisBase axis) {

        return time.get((int)value).concat(" mins");
    }

标签: androidandroid-studiobar-chart

解决方案


推荐阅读