SetPieAutoSize — Enable or disable automatic pie chart size calculation




SetPieAutoSize controls the automatic pie chart size calculation. When this is enabled, PHPlot calculates the size of the pie by taking the label sizes into account.



True to enable automatic size calculation, or False to use the maximum area.


By default, automatic pie chart sizing is enabled.

If automatic pie chart sizing is disabled, PHPlot will make the pie as large as possible to fit within the plot area (see SetPlotAreaPixels), minus a small 5-pixel margin on each side. The center of the pie is always at the center of the plot area.

If automatic pie chart sizing is enabled, PHPlot will leave additional room within the plot area for the pie chart labels. It will calculate the maximum width and height of the labels, and use these to increase the margins. Note that it does not take into account where each label is displayed. For example, if there is a very wide label displayed only at the top of the pie, this will still result in a decrease in overall pie width.

If pie labels are either disabled or positioned inside the pie (using SetLabelScalePosition), then SetPieAutoSize() has no effect. Whether automatic sizing is on or off, the pie chart will use the maximum size in this case, since no additional space is needed for labels.

With automatic pie chart sizing enabled, PHPlot prevents overly long labels from resulting in a pie chart which is too small. It does this by limiting the minimum pie size to one half of the plot width or height, even if this causes labels to run off the edge. This behavior can be adjusted - see Section 4.7.5, “Tuning Pie Charts” for more.


This function was added in PHPlot-5.6.0. In earlier releases, PHPlot never took label sizes into account when calculating the pie size. Note that the default True is not backward compatible. However, there were additional changes made to pie chart sizing and label positioning in PHPlot-5.6.0, such that neither enabling nor disabling automatic sizing will produce identical results compared to previous releases. 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.