Syntax
[C/C++:]
void ggPlotPieChart(int nsegs, float *value, char *string[ ], int *fill, int *line);
[F90:]
subroutine ggPlotPieChart(nsegs, value, string, fill, line)
integer, intent(in) :: nsegs, fill(*), line(*)
real, intent(in) :: value(*)
character*(*), intent(in) :: string(*)
Arguments
nsegs
The number of segments to be plotted (between 1 and 50)
value
Array, of dimension
nsegs, of segment values for the chart. These need not be percentages as ggPlotPieChart() calculates the percentage value of each segment automatically
string
Array of dimension
nsegs, holding the labels for the segments
fill
Integer array, of dimension
nsegs, determining the fill styles to be used to fill each segment
|
< -1 |
Specifies no fill and no boundary |
|
=  GHOLLOW |
Specifies boundary only |
|
=  GSOLID |
Specifies a solid fill |
|
=  GFINELEFTDIAGONAL |
} |
|
=  GFINERIGHTDIAGONAL |
} |
|
=  GFINEHORIZONTALGRID |
} |
|
=  GFINEDIAGONALGRID |
} |
|
=  GFINEHORIZONTALMESH |
} Specifies the hatch |
|
=  GFINEDIAGONALMESH |
} style index |
|
=  GCOARSEHORIZONTAL |
} |
|
=  GCOARSELEFTDIAGONAL |
} |
|
=  GCOARSERIGHTDIAGONAL |
} |
|
=  GCOARSEHORIZONTALGRID |
} |
|
=  GCOARSEDIAGONALGRID |
} |
|
=  GCOARSEHORIZONTALMESH |
} |
|
=  GCOARSEDIAGONALMESH |
} |
|
>256 |
Specifies a solid fill for software fill, or the fill style index for hardware fill |
line
Integer array, of dimension
nsegs, determining the line style to be used to fill each segment
|
= GCURRENT |
Specifies the current line style |
|
= 1 to 256 |
Specifies the line style index |
|
>256 |
Specifies the current line style |
The value of an element of
line is irrelevant where the corresponding element of
fill has a value less than -1
Description
The routine ggPlotPieChart() draws a complete annotated, filled Pie Chart. The Pie Chart is drawn to fit the available drawing window, or with respect to the Pie Chart frame defined by the most recent call to ggSetPieChartFrame(). The segments are drawn anticlockwise from the three o'clock position, or from the start angle defined by the most recent call to ggSetPieChartStartAngle(). The absolute value for each segment takes a proportion of the pie. The proportion is defined as the segment value divided by the sum of all the segment values.
Each segment of the Pie Chart consists of the following elements; the background filling, the annotation and associated box and the segment boundary.
The segments are filled in the style determined by the combination of the corresponding elements of
fill and
line. Where a
fill element is equal to GHOLLOW, only the boundary of the segment is drawn. One or more of the segments may be left unfilled by giving the corresponding element(s) of
fill a value of -2 or less. Negative values of
line cause a warning to be output and the absolute value is used. The default line styles, hatch styles and fill styles appear in Appendix A of this manual (see
Defaults). The current line style is left unchanged.
The default annotation for the Pie Chart is to print the segment label horizontally in a masked box within the segment boundary. Other forms of annotation are available including radial and external, each of which may include a combination of the segment label, the percentage value of the segment and the data value itself. All these options are set with the Pie Chart annotation routine ggSetPieChartAnnotation().  The routine ggSetPieChartBoxType() controls the filling/masking and drawing of the annotation box for internal segment annotation.
By default the segment boundaries are drawn in the current pen colour, these can be switched off using ggSetPieChartBoundSwitch().
Individual segments may be extracted from the Pie Chart centre using the routine ggSetPieChartExplosion().
See Also
ggPlotPieChart UsageggSetPlotFrameggSetPieChartStartAngleggSetPieChartAnnotationggSetPieChartBoxTypeggSetPieChartBoundSwitchggSetPieChartExplosionggSetPieChartFrame