_pie.pub Utility - Pie Charts

Syntax

call "_pie.pub",chan,data[all],r0,r1,c0,c1,title$,
legend$[all],rotate,options$

Description

The _pie.pub utility is used to draw a pie chart. Unlike bar charts, pie charts are primarily one-dimensional. They deal with a homogenous pool of values and show each value's percentage of contribution to the whole.

Parameter

Description

chan

Channel number of a previously OPENed graphics device (D0, D1, etc...).

data[all]

Data to be charted. For consistency with _bar.pub, DATA[ALL] must be two-dimensional even though a pie would typically represent a single row or column. Unlike _bar.pub, there is no special significance to a row versus a column. All of the values in DATA[ALL] have the same meaning and contribute to the same pie.

r0,r1

Range of rows in DATA[ALL] to use for the chart. This allows you to dimension DATA[ALL] to any range or to chart a portion of DATA[ALL].

c0,c1

Range of columns in DATA[ALL] to use for the chart. The _pie.pub program will use only DATA[R0:R1,C0:C1].

title$

Main title at the top of the chart. A backslash "\" in TITLE$ may be used to indicate a new line. Therefore, the chart title may be any number of centered lines.

legend$[all]

Chart legend. Each string in LEGEND$[ALL] provides a label for a piece of the pie. R0, R1, C0, and C1 are also used to access LEGEND$[ALL]. Any string in LEGEND$[ALL] beginning with a "!" will cause the corresponding pie slice to be exploded (the "!" will not be printed with the label). Any null string in LEGEND$[ALL] will bypass any labeling of the corresponding pie slice. The labels may be displayed as an actual legend box in the corner of the graph or they may be "attached" to each piece of the pie, depending on the OPTIONS$.

rotate

Pie rotation, in radians. A positive value rotates the pie in a counter-clockwise direction. For example, this could be used to move an important piece to a known location such as the top.

options$

Chart options. If more than one option is used, the options should be separated by spaces. The options currently supported are:

"l"

Specifies that the pie labels should be printed in a legend in the corner of the chart as opposed to the default attaching each label to the pie.

l(font,size)

Provides special text style information for the legend labels. The font value is the value to be used in a 'FONT'(N) mnemonic. The caller is responsible for loading all fonts prior to the CALL. size is a numeric value indicating the scale of the text. For example, .5 would be half as large and 2 would be twice as large.

"%"

Prints percentages along with the labels.

See Also

Alphabetical Utilities

Functional Listing of Utilities