Reputation: 3113
I am using MPAndroidChart library and I want to remove the values in in the top right corner of the PieChart
, how can I do this ?
Upvotes: 12
Views: 7401
Reputation: 169
Add this code into xml file:
<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>
Write this into .java file:
pieChart = findViewById(R.id.pie_chart);
Legend l = pieChart.getLegend();
l.setEnabled(false);
Upvotes: 0
Reputation: 51411
The values you are talking about belong to the Legend.
To disable them (prevent them from being displayed), call
Legend l = chart.getLegend();
l.setEnabled(false);
Upvotes: 29
Reputation: 11
you can set like this
linechart.setData();
...
linechert.getLegend().setEnable(false);
gone Legend should be at the back of setData()
Upvotes: 1