我想要独立于mpchart库的barchart的栏。
我尝试应用百分比等,但没有得到预期的结果。
for(int i = 0; rs.next();) {
float totalplanned=(rs.getFloat("PlannedReco")+rs.getFloat("AdvTrgt"))/1000000;
float advanceplanned=(rs.getFloat("AdvTrgt"))/1000000;
float creditplanned=(rs.getFloat("PlannedReco"))/1000000;//
float totalachieved=(rs.getFloat("AdvanceAchi")+rs.getFloat("CreditAchieved"))/1000000;
float advanceachi=(rs.getFloat("AdvanceAchi"))/1000000;
float creditachieved=(rs.getFloat("CreditAchieved"))/1000000;
float totalplannedPer=(totalplanned/totalplanned)*100;
float advanceplannedPer=(advanceplanned/totalplanned)*100;
float creditplannedPer=(creditplanned/totalplanned)*100;
float totalachievedPer=(totalachieved/totalachieved)*100;
float advanceachiPer=(advanceachi/totalachieved)*100;
float creditachievedPer=(creditachieved/totalachieved)*100;
yVals1.add(new BarEntry(i++, new float[]{advanceplannedPer,creditplannedPer,totalplannedPer}));
yVals1.add(new BarEntry(i++, new float[]{advanceachiPer,creditachievedPer,totalachievedPer}));
}
答案 0 :(得分:0)
现在我已经完成了
float floatValue = 0.5f;
内部循环
entries.add(new BarEntry(floatValue, Math.abs(valueFloat)));
floatValue = floatValue + 1;
因此,条目之间的间隙将相同,宽度也将相同