Currently I use the MPAndroidChart from GITHUB and draw the piechart to display the two line text, each line has different color and different font size,I check the source codes
after study the source codes, i change the PieChartRenderer.java to change the
mCenterTextPaint.setColor(Color.parseColor("#333333"));
mCenterTextPaint.setTextSize(Utils.convertDpToPixel(20f));
mCenterTextPaint.setTextAlign(Align.CENTER);
then use the "\n" as a split to get the first line
int index = centerText.indexOf("\n");
Spannable tempSpannable = new SpannableString(centerText);
tempSpannable.setSpan(new RelativeSizeSpan(0.75f), 0, index, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
tempSpannable.setSpan(new ForegroundColorSpan(Color.parseColor("#999999")),
0, index, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
// If width is 0, it will crash. Always have a minimum of 1
mCenterTextLayout = new StaticLayout(tempSpannable, 0, centerText.length(),
mCenterTextPaint,
(int)Math.max(Math.ceil(mCenterTextLastBounds.width()), 1.f),
Layout.Alignment.ALIGN_NORMAL, 1.f, 0.f, false);
then get what i wanted is