# Correct location for a pie chart internal label

I'm producing pie charts algorithmically. In many cases, each segment of a pie chart should contain a label inside the segment (space permitting). Where exactly should the label be placed in order to be more-or-less perceptually centered?

My leading approach is to inscribe a circle inside the segment and center the label inside that circle. Then, if the label does not fit in the circle, it will have to be moved outside the chart.

An alternative is the centroid of the section. To me, this didn't look quite as good.

Is there a common convention for this? Is there an approach often taken by high-quality tools that I should be aware of?

Example of the inscribed circle approach:

• I honestly don't think there's any formula for this beyond "what looks good". May 17, 2017 at 16:50
• Your algorithm is fine and will work but the center of a shape is not always the best place to have a title. The \$100 may look more balanced in the chart if it was up next to the blue pie piece, or under the tip, centered. Correct placement is found through the balance of up/down, left/right and empty space. May 17, 2017 at 19:47
• True, but the trick is expressing the notion of balance algorithmically. Is there an alternative algorithm or a modification of this algorithm that you think may provide better results in some cases? I'm not bound to this algorithm, or even to using the same algorithm in all cases. (As a trivial example, my implementation has special cases for segments that constitute more than half the pie and for segments that take up the entire pie.) May 17, 2017 at 21:53
• Alternative - Centered on area arc relative to outer curve (and 25% is actually 25%) - Not necessarily better, just different. Which is really all any solutions will be. May 18, 2017 at 22:55

## 1 Answer

I apologize because this is not really an answer to your question, but it was getting too long for a comment.

I think the problem is that you stated in your question that you want the titles to be centered "perceptually." There may be a more specific definition of "perceptually" that I don't know, but the way I read that it means that the titles should LOOK balanced, whether or not they actually are balanced.

As @Webstarian said in the comments, all kinds of issues impact our perception of balance in design. Darker colors recede, bright items can appear larger than they actually are. Like Webstarian, when I look at your pie chart, the maroon slice appears really bottom heavy to me--to balance that, my gut says to pull the label up higher and to the right, even though that is completely out of the range of your algorithmic guides.

I can't speak for what algorithms are used in high-end software programs for determining where labels should go--but I use Adobe's InDesign frequently for layout, and they have layers upon layers of tools allowing you to tweak the location, spacing, slant, etc. for every single item you place on a page, for the individual letters in a sentence, etc. And the reason they offer that level of adjustment is because I don't believe there is any way for a program to account for all of the "tricks" our brains play on us when the information that enters through our eyes gets interpreted by our brain.