private PieChart mChart;
mChart = (PieChart) findViewById(R.id.pieChar);
String[] titles = new String[] {"钱包余额","金钱袋资产","金宝箱资产"};
mChart.setTitles(titles);
int[] colors = new int[]{0xfff5a002,0xfffb5a2f,0xff36bc99};
mChart.setColors(colors);
mChart.setValues(new double[]{111,111,111});
mChart.postInvalidate();
xml布局文件里面添加
<cn.lib.ui.widget.PieChart
android:id="@+id/pieChar"
android:layout_width="match_parent"
android:layout_height="match_parent" />