# How to place Labels inside of a Pie Chart

Hi All!

FYI. Here is a combination of three chart types: **Bubble**, **Scatter** and **Pie**:

*

*

*

*

Good luck

Tahir, thank you for your interest in this topic.

Next, I will try to give little explanations on my solution to the problem.

To display labels in each Pie sector, you need to use a combination of two graphs: one is Pie (2D) chart without labels at the bottom of composition, the other – Scatter (2D) chart with labels at the top of composition.

*

*

The problem comes down to calculating (X, Y) coordinates for the Scatter points relating to each Pie sector. To get the (X, Y) coordinates of the Scatter points, we need to calculate the average values of each Pie sector, and output both the points and the labels we need for these points to the imaginary radii through these average values. The figure below shows how to make all calculations within a single matrix.

*

*

Notes.

1. Radius changes around 0.6 +- 15%.

2. ClearZero() disallows empty label output if you enter zero or empty as PieCD values.

3. Na() in formulas for ScatX and ScatY disables Scatter points output if you enter zero or empty as PieCD values.

…

In the case of a large number of small values in the source data, I would use one of two ways. The first way is the main one: to integrate small values by threshold into one Pie chart sector called ‘others’ so that the total number of Pie chart sectors does not exceed 5 – 6. Below is the example of how I imagine this method:

*

*

The module Generate Items of the QM will easily generate the required number of Category Items (PieCD::F) by the Cut-off threshold parameter (3%):

Where:

- COT means of Cut-off threshold (3%);
- A1:B – range of initial data (20 Items).

Now let’s fill in the cells PieCD::F using the formula:

That is about all. Use PieCD::F values to build a Pie (2D) chart as usual.

*

The second way is to display Scatter points with labels at different distances (radiuses) from the center of the Pie chart + select right font and its size + select right diameter of the Pie chart. But here I do not consider this method in detail.

Good luck

Here is chart’s reaction to the empty:

*

*

Here is chart’s reaction to the null:

*

*

Good luck.

Great work, SAU! My only concern is what happens when you have many small numbers, which can mix inside the pie. Would be interesting if you explain how you did it.