我正在使用MPAndroidChart库,我想要移除饼图顶部右侧的数值,应该如何操作?
linechart.setData();
...
linechert.getLegend().setEnable(false);
尝试 pieChart.setDrawSliceText(false)
<com.github.mikephil.charting.charts.PieChart
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/pie_chart">
</com.github.mikephil.charting.charts.PieChart>
将以下内容写入 .java 文件中:
pieChart = findViewById(R.id.pie_chart);
Legend l = pieChart.getLegend();
l.setEnabled(false);
chart.setDrawLegend(false);
。 - Filipe Ramos