haouas rim
haouas rim

Reputation: 61

How to remove the central white circle in a pie chart

I made a pie-chart in my Android app and I have a white cerce in the middlle I tried to remove it but I couldn't even the piechart.setCentralCirculaire doesn't work in my code. Is there any way that I can do that? Thanks.

Chart

pieChart=(PieChart)findViewById(R.id.Piechart);
pieChart.setRotationEnabled(true);

addDataSet();

private void addDataSet(){
    Log.d(TAG, "addDataSet: ");
    ArrayList<PieEntry> yEntrys=new ArrayList<>();
    yEntrys.add(new PieEntry(15.0f, "LOW"));
    yEntrys.add(new PieEntry(50.0f,"Normal"));
    yEntrys.add(new PieEntry(25.0f,"hyper"));
    PieDataSet pieDataSet= new PieDataSet(yEntrys,"Employee Global Activity");
    pieDataSet.setSliceSpace(2);
    pieDataSet.setValueTextSize(12);
    ArrayList<Integer> colors =new ArrayList<>();
    colors.add(Color.RED);
    colors.add(Color.BLUE);
    colors.add(Color.GREEN);
    pieDataSet.setColors(colors);
    PieData pieData =new PieData(pieDataSet);
    pieChart.setData(pieData);
    pieChart.invalidate();
}

Upvotes: 4

Views: 3125

Answers (2)

Said CHAOUCHE
Said CHAOUCHE

Reputation: 695

piechart.setDrawHoleEnabled(false);

Upvotes: 5

If i understand right this is a MPAndroidChart, so you uses.

piechart.setHoleRadius(0.0f);

Upvotes: 1

Related Questions