Search code examples
androidpie-chartmpandroidchart

How to change text color of pie chart description in MPAndroidChart?


I am creating a pie chart using the MPAndroidChart library. In my app, I am having a black background and the text color of the pie chart description is grey be default which is not good for me. I am not able to change it.

How do I change the text color of the description?

My pie chart:


Solution

  • use setDescriptionColor(int color) method

    chart.setDescriptionColor(getResources().getColor(R.color.your_color));