cici
cici

Reputation: 41

How to fix piechart overlap centertext in MPAndroid Chart

enter image description here

I don't know how to fix this problem.

pieChart.setHoleRadius(90);
pieChart.setCenterTextSize(18);
pieChart.setCenterText(getResouces().getString(R.string.test)+"\n\n"+minStr);

Upvotes: 0

Views: 180

Answers (2)

Haroun Hajem
Haroun Hajem

Reputation: 5628

You can choose one of these solutions:

  • Shrink the font size.
  • Put "\n\n" before your text. pieChart.setCenterText("\n"+getResouces().getString(R.string.test)+"\n\n"+minStr);
  • Change the text to something shorter.

Upvotes: 0

Oussema Aroua
Oussema Aroua

Reputation: 5339

Try to change the text size using :

mData.setValueTextSize(16f);

Upvotes: 1

Related Questions