6
$\begingroup$

There are numerous options in Marthematica for pie chart labels positioning:

PieChart[Range[10], ChartLabels -> Placed[Range[10], "RadialCallout"], SectorOrigin -> {Automatic, 1}] 

will display:

enter image description here

And this code:

Table[PieChart[{1, 2, 3}, ChartLabels -> Placed[{"a", "b", "c"}, p], SectorOrigin -> {Automatic, 1}, PlotLabel -> p], {p, {"RadialInner", "RadialCenter", "RadialOuter"}}] 

will display this:

enter image description here

How can one obtain labels so that only labels for several smallest sections are displayed outside the pie, using callouts, and all other labels are in the center or close to the center of correspondent sections? Like this:

enter image description here

Or:

enter image description here

$\endgroup$

1 Answer 1

11
$\begingroup$

Wrapping input data with Labeled:

PieChart[Labeled[#, #, If[# < 5, "RadialCallout", "RadialCenter"]] & /@ Range[10], SectorOrigin -> {Automatic, 1}] 

enter image description here

PieChart3D[Labeled[#, #, If[# < 5, "RadialCallout", "RadialCenter"]] & /@ Range[10], SectorOrigin -> {Automatic, 1}, ChartElementFunction -> ChartElementDataFunction["ProfileSector3D", "Profile" -> 3.1`]] 

enter image description here

Using LabelingFunction:

PieChart[Range[10], SectorOrigin -> {Automatic, 1}, LabelingFunction -> (Placed[#, If[# < 5, "RadialCallout", "RadialCenter"]] &)] 

enter image description here

PieChart3D[Range[10], SectorOrigin -> {Automatic, 1}, LabelingFunction -> (Placed[#, If[# < 5, "RadialCallout", "RadialCenter"]] &), ChartElementFunction -> ChartElementDataFunction["ProfileSector3D", "Profile" -> 3.1`]] 

enter image description here

See also: Customizing individual labels in a PieChart

$\endgroup$
2
  • $\begingroup$ Great answer this adds a lot of flexibility! $\endgroup$ Commented Nov 11, 2014 at 13:17
  • $\begingroup$ @Dragan, thank you for the accept; and welcome to mma.se. $\endgroup$ Commented Nov 11, 2014 at 13:22

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.