我正在使用我的应用程序的条形图
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
我试图在字符串中传递x轴值,但显示错误。还有其他选择吗?
答案 0 :(得分:0)
尝试此代码, 我希望这段代码对您有用。
List<BarEntry> entries = new ArrayList<>();
List<BarEntry> entries1 = new ArrayList<>();
List<BarEntry> entries2 = new ArrayList<>();
for (int i = 0; i < difficultyLevelCountList.size(); i++) {
entries.add(new BarEntry(i, Float.parseFloat(difficultyLevelCountList.get(i).getIncorrect()),"try"));
entries1.add(new BarEntry(i, Float.parseFloat(difficultyLevelCountList.get(i).getCorrect()),"try"));
entries2.add(new BarEntry(i, Float.parseFloat(difficultyLevelCountList.get(i).getMissed()),"try"));
}