SetLabelScalePosition — Position pie-chart labels




SetLabelScalePosition adjusts the position of the pie chart data labels which identify the pie segments.



Position factor for the pie chart labels. This is a floating point number. The default value is 0.5, which places the labels just outside the pie circumference. See notes below.


This affects pie charts only.

Values greater than or equal to 0.5 place the labels outside the pie. The default value 0.5 places the labels outside and close to the pie circumference. Larger values move the labels away from the pie. A value of 1.0 would place the labels about twice as far from the pie center as the pie radius.

Values less than 0.5 place the labels inside the pie circumference, with smaller values moving the labels in towards the center. To place the labels just inside the pie circumference, use 0.49 (for example). Using 0 (or False) results in no labels at all.

A more detailed definition of the label scale position parameter is that it is a scale factor applied to the diameter of the pie (at the angle where the label will be drawn), which determines the text basepoint for the label. However, PHPlot adjusts the result when it is close to the pie circumference.

Note that PHPlot sizes the pie chart so the labels fit inside the plot area, if possible. This means the label scale position will affect the pie size, if greater than or equal to 0.5.

To control the pie chart label contents, see SetPieLabelType.


Starting with PHPlot-5.6.0, the label scale position argument was interpreted as above, with values greater than or equal to 0.5 meaning outside the pie, values less than 0.5 meaning inside, and 0 meaning no labels. Through PHPlot-5.5.0, the label scale position was used with less precision, and included an additional 1.2 scale factor to try to move the labels further out in the hope that they would be clear of the pie.

Accepting 0 or False as a valid argument value to disable the labels was added in PHPlot-5.6.0. Before that, the labels were always plotted.

The ability to control pie label contents, and the automatic sizing of the pie to leave room for labels, were added in PHPlot-5.6.0. Through PHPlot-5.5.0, pie chart labels always displayed segment percentages, and the pie size was calculated without regard to the labels. Logo

This version of the manual was produced for the PHPlot Sourceforge project web service site, which requires the logo on each page.

To download a logo-free copy of the manual, see the PHPlot project downloads area.