2017-02-23 120 views
-2

我在我的Android应用程序中制作了一个饼图,并且在middlle中有一个白色的棋子我试图将其删除但我不能t even the piechart.setCentralCirculaire`不起作用在我的代码中。无论如何,我可以这样做,谢谢。如何删除饼图中的中央白色圆圈

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(); 
} 
+0

查看截图你想说什么? – Piyush

+0

那里是饼图的画面 –

+0

你想展示哪个白色圆圈? –

回答

1

如果我的理解对不对,这是一个MPAndroidChart,让你使用。

piechart.setHoleRadius(0.0f); 
+0

是它的一个MPAndroidChart。它的作品谢谢,但给了我透明的cercle反正teher改善它的外观? –

+0

使用piechart.setTransparentCircleColor(int color); –

+0

我希望饼图中的文本和数据具有相同的颜色,我使用了pieDataSet.setColor和piechart.setValuetextColro,但它的工作量很大 - –

0
piechart.setDrawHoleEnabled(false);