我正在尝试使用MPAndroidChart库在我的Android应用程序中放置雷达图。
我看到了this非常相似的问题,并尝试了这种方法,但对我而言不起作用
这是我的代码
RadarChart chart = findViewById(R.id.activity_family_member_detail_chart);
Drawable iconTotalEarnedPoints = getDrawable(R.drawable.ic_star_border);
Drawable iconEarnedMoney = getDrawable(R.drawable.ic_attach_money);
Drawable iconTextPosts = getDrawable(R.drawable.ic_message);
Drawable iconImagePosts = getDrawable(R.drawable.ic_photo_size_select_actual);
Drawable iconAudioPosts = getDrawable(R.drawable.ic_audiotrack);
List<RadarEntry> entries = new ArrayList<>();
entries.add(new RadarEntry(member.getTotalEarnedPoints(), iconTotalEarnedPoints));
entries.add(new RadarEntry(member.getEarnedMoney(), iconEarnedMoney));
entries.add(new RadarEntry(member.getTextPosts(), iconTextPosts));
entries.add(new RadarEntry(member.getImagePosts(), iconImagePosts));
entries.add(new RadarEntry(member.getAudioPosts(), iconAudioPosts ));
RadarDataSet radarDataSet = new RadarDataSet(entries, "");
RadarData radarData = new RadarData(radarDataSet);
chart.setData(radarData);
chart.getLegend().setEnabled(false);
chart.getDescription().setEnabled(false);
chart.getYAxis().setEnabled(false);
chart.animateXY(1000, 1000);
chart.invalidate();
我得到的结果是一台显示正确值的雷达,但是标签是数字(从0到4),而我希望使用指定的可绘制对象而不是数字,我该如何实现呢? / p>