# Does the VerticalCallout algorithm in PieChart3D work correctly?

In real world usage you often want to use real world labels with long strings (say 15-20 characters) in 3D pie charts. Here is a toy example :

Clear[labeler];
labeler[datax_][v_, {1, c_}, ___] :=
Placed[Column[{datax[[c]], v}, Alignment -> Center,
BaseStyle -> Directive[FontFamily -> "Arial", 11]],
"VerticalCallout"];
data = Transpose[{"This is label " <> ToString[#] & /@ Range[14],
Range[14]}];

PieChart3D[{data[[All, 2]]},
ChartElementFunction ->
ChartElementDataFunction["ProfileSector3D", "Profile" -> 4],
ChartStyle -> 54,
ImageSize -> 400,
LabelingFunction -> labeler[data[[All, 1]]],
PerformanceGoal -> "Speed",
PlotRange -> All,
SectorOrigin -> {Pi, 0},
SectorSpacing -> 0.2]


We see that the plot area seems to have been determined without reference to the labels that will be placed around the chart. Consequently the labels are cut off.

Q. Is this an Image Padding issue? A. no (note that All gives the same output as Full)

Q. So why not expand the margins around the image to give the labels enough space to be rendered?

So increasing the image margins merely creates another graphics area around the original image.

This looks like a bug or design flaw to me. Does anyone have any ideas about how to get VerticalCallout labels working in PieChart3D?

-
Setting ImagePadding to 100 works for me with your example. Also, possible duplicate ;-) –  rasher Apr 22 '14 at 2:05
Not really a duplicate @rasher :) The other post is dealing with vertical alignments. This one deals with visible range. Still looks like a bug or design flaw because ImagePadding->All should adjust to include the labels. i.e. you should not have to set a value for each specific chart. Having said that, the manual value for ImagePadding does provide a work around. –  Mike Honeychurch Apr 22 '14 at 3:01
Ah - just saw titles, figured it was double-submit... sorry. Glad manual setting at least provides work-around. –  rasher Apr 22 '14 at 3:06
It seems like a ViewPoint issue. Try setting something like ViewPoint -> 1.4 {0, -2.4, 2}. (That vector is the default for PieChart3D.) Possible feature suggestion for WRI? "Make Graphic3D et al smart enough to scale ViewPoint to account for labels" or something to that effect? –  billisphere Apr 22 '14 at 4:06

WRI Tech support confirm a bug. ImagePadding->All should work.
To address Bretts comment: In 2D ImagePadding->All works -- the ImageSize increases in the x direction by the amount of padding required. Nothing has to give. Why does something have to give in 3D?
@BrettChampion If it is intended, as opposed to a genuine bug, that something has to "give" then it seems pointless offering "VerticalCallout" and RadialCallout" as labelling options in 3D for real world usage. In 2D of course nothing "gives" and ImagePadding->All works as expected. ...but then the vertical alignments of labels issues exists mathematica.stackexchange.com/questions/46549/… –  Mike Honeychurch Apr 23 '14 at 22:31
@BrettChampion I could stick labels in a Pane with fixed size, and have them wrap, and then set a fixed ImagePadding based on the Pane width but still not seeing why ImagePadding->All does not work. –  Mike Honeychurch Apr 23 '14 at 22:38
Can you post your code for that 2D chart? I'm not reproducing it. According to the docs for ImagePadding, "Padding specified by ImagePadding is left inside the region defined by ImageSize" (emphasis mine) so your picture in not what I expect to happen. –  Brett Champion Apr 24 '14 at 3:18
@BrettChampion the code is the same as the link in my first comment. Only change was to sub your first comment as one of the labels. I use ImageSize->{All,300} to ensure I get it all, otherwise what you state from the docs occurs. But this only works in 2D –  Mike Honeychurch Apr 24 '14 at 3:52