Android 不推荐使用setDrawSliceText(布尔值)
有没有办法解决Android 不推荐使用setDrawSliceText(布尔值),android,mpandroidchart,Android,Mpandroidchart,有没有办法解决setDrawSliceText不推荐使用的问题。我没有找到任何解决办法 如何获取pieChart.setDrawSliceText(false)已弃用,但在其javadoc中声明: /** * Set this to true to draw the entry labels into the pie slices (Provided by the getLabel() method of the PieEntry class). * Deprecated -> use
setDrawSliceText
不推荐使用的问题。我没有找到任何解决办法
如何获取
pieChart.setDrawSliceText(false)代码>已弃用,但在其javadoc中声明:
/**
* Set this to true to draw the entry labels into the pie slices (Provided by the getLabel() method of the PieEntry class).
* Deprecated -> use setDrawEntryLabels(...) instead.
*
* @param enabled
*/
因此,请使用setDrawEntryLabels
代替,并举例说明:
ArrayList<PieEntry> yvalues = new ArrayList<PieEntry>();
yvalues.add(new PieEntry(8f, "", 0));
yvalues.add(new PieEntry(15f, "", 1));
yvalues.add(new PieEntry(12f, "", 2));
PieDataSet dataSet = new PieDataSet(yvalues, "");
dataSet.setDrawValues(false);
ArrayList yvalues=新的ArrayList();
添加(新条目(8f,“,0));
添加(新条目(15f,“,1));
添加(新条目(12f,“,2));
PieDataSet数据集=新的PieDataSet(yvalues,“”);
dataSet.setDrawValues(false);