Androidplot-格式化条形图上的点标签(删除小数)

Androidplot-格式化条形图上的点标签(删除小数),androidplot,Androidplot,我一直在寻找如何格式化条形图上点标签的文本(删除小数)。 这是我的代码: BarFormatter bf = new BarFormatter(Color.CYAN,Color.CYAN); PointLabelFormatter plf = new PointLabelFormatter(); plf.getTextPaint().setColor(Color.BLUE); bf.setPointLabelFormatter(plf); 我只能在这里设置颜色。标签以小

我一直在寻找如何格式化条形图上点标签的文本(删除小数)。 这是我的代码:

BarFormatter bf = new BarFormatter(Color.CYAN,Color.CYAN);
    PointLabelFormatter plf = new PointLabelFormatter();
    plf.getTextPaint().setColor(Color.BLUE);
    bf.setPointLabelFormatter(plf);
我只能在这里设置颜色。标签以小数显示。如何在这种情况下删除它或设置十进制格式?
此注释描述lineandpointformatter下的pointlabeler。如何为条形图实现此功能?

应该与您链接的内容相同-
BarFormatter
扩展
LineAndPointFormatter

bf.setPointLabeler(new PointLabeler<XYSeries>() {
    final DecimalFormat df = new DecimalFormat("#");

    @Override
    public String getLabel(XYSeries series, int index) {
        return df.format(series.getY(index));
    }
});
bf.setPointLabeler(新的PointLabeler(){
最终判定格式df=新判定格式(“#”);
@凌驾
公共字符串getLabel(XYSeries系列,int索引){
返回df.format(series.getY(index));
}
});