我使用mpandroidchart为我的项目显示折线图,我的yAxis值是pura Arraylist,例如{" 0.9568"," 1.3294," 4.5238"},我使用方法Float.parseFloat()将字符串类型更改为float type.look,代码如下:
for (int i = 0; i < list1.size(); i++) {
String unitnetvalue = list1.get(i).getUnitnetvalue();
float unitVal = Float.parseFloat(unitnetvalue);
//float unitVal=Float.valueOf(unitnetvalue);
//float unitVal=Float.parseFloat(unitnetvalue.replaceAll(",", ""));
yVals.add(new Entry(unitVal, i));
xVals.add(list1.get(i).getEnddate());
zdVals.add(list1.get(i).getNetastrate());
list.add(unitVal);
}
然后yAxis会显示值为1,1,4,我想显示值0.9568,1.3294,4.5238,我该如何做我想要的?