Vidhyasagar
Vidhyasagar

Reputation: 173

How do I change the pie chart value text size?

I'm trying to create a Pie chart using MPAndroidChart. How do I set the text size for the values displayed on the chart pertaining to the various percentages of components specified?

In short, I want to make these labels appear bigger:

a pie chart with percentage labels in the slices

Upvotes: 7

Views: 7305

Answers (3)

Ashif
Ashif

Reputation: 471

this is work for me

   PieData data = new PieData(dataSet);
  // for set value of text label
   data.setValueTextSize(8f);
  // if you want change Label text 
   pieChart.setEntryLabelTextSize(8f);// pieChart is a object Of Piechart u can get by using findviewbyid

Upvotes: 0

Akshay Chavan
Akshay Chavan

Reputation: 281

Try this:

pieChart.setEntryLabelTextSize(8f);

This will change the size of your piechart slice label.

Upvotes: 2

marco
marco

Reputation: 3242

// reference to your data
PieData data = new PieData(labels, dataSet);

// this increases the values text size  
data.setValueTextSize(40f); // <- here

Upvotes: 15

Related Questions