Text Color for X-axis lables
@PhilJay Thanks for this awesome library.
I could not find a way to change color of x-axis lables. I was able to change text color of y axis values using mChart.setValueTextColor(getResources().getColor(android.R.color.white));
But this changes text color of only y-axis values in Bar Chart.
Closing this issue. There is a way to set text color for XLables using following code : XLabels labels = mChart.getXLabels(); labels.setTextColor(getResources().getColor(android.R.color.white));
@rutvijkumarshah I'm not finding .getXLabels()
Is this on an older version?
@surfer190 , yeah its with old version, I filed the issue one year ago.
@rutvijkumarshah It isn't working. then how to set color for x-axis Labels for Pie-Chart ?
Try it.
Chart.getXAxis().setTextColor(Color.Blue);
OR
XAxis xLabels = Chart.getXAxis(); xLabels.setTextColor(Color.Blue);
getXAxis() - deprecated, and throws RuntimeException("PieChart has no XAxis"). What is the new way to change x-axis text color?
if you want to change the text color of lables try it..
mChart.setEntryLabelColor(Color.BLUE);
or if you want to change value color try it..
PieData data = new PieData(dataSet); data.setValueTextColor(Color.RED);
i hope it works..
Thanks! It helped me, and saved a lot of time.
legend will do
pieChart.getLegend().setTextColor(Color.WHITE);
I have this issue now on a linechart, the text color of my x-labels changes to a dark purple but will not change to any other color.
I have this issue now on a linechart, the text color of my x-labels changes to a dark purple but will not change to any other color.
I know its a late reply but surely it will help others as it is common mistake Use below line for that
ContextCompat.getColor(context, R.color.red_color)
The mistake is that you are providing the id of color ( by giving only R.color.some_color) not the actual color
is it possible to give multiple colours to labels in pie chart? like this:

is it possible to give multiple colours to labels in pie chart? like this:
I would also love to be able to have each label with a different color, to match the color of the bar.