Im trying to use the MPAndroidChart library to develop a circular chart. But only Pie chart is available. So i tried giving two xvalue coordinates, with one color similar to background. So i got something similar to circular chart. But i'm not able to change the background color and font color of center text inside the pie chart?
Thanks!
To set center color:
mChart.setDrawHoleEnabled(true);
mChart.setHoleColor(...);
To set center text
mChart.setDrawCenterText(true);
mChart.setCenterText(...);
There are two possible solutions:
Retrieve the Paint
object used by the chart to draw the "center-hole" and modify it the way you want
Paint p1 = mChart.getPaint(Chart.PAINT_HOLE);
p1.setColor(...);
Paint p2 = mChart.getPaint(Chart.PAINT_CENTER_TEXT);
p2.setColor(...);
Or use this, if you only display one value anyway: CircleDisplay
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With