Eman
Eman

Reputation: 63

How to add label outside the pie chart

How to add values text and slice text outside the chart?

Similar to this image:

enter image description here

Thanks

Upvotes: 4

Views: 1541

Answers (2)

I got the solution by doing these codes. But don't add a Value text color that matches the background.

dataSet.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
dataSet.setYValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);

Upvotes: 0

Misha Akopov
Misha Akopov

Reputation: 13027

Please try this:

dataSet.setXValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);
dataSet.setYValuePosition(PieDataSet.ValuePosition.OUTSIDE_SLICE);

Those properties put labels outside of chart

Upvotes: 8

Related Questions