_bar.pub Utility - Bar Charts

Syntax

call "_bar.pub",chan,data[all],r0,r1,c0,c1,title$,
xtitle$,ytitle$,xtic$[all],legend$[all],maxy,options$

Description

The _bar.pub utility is used to draw a bar chart.

Parameter

Description

chan

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

data[all]

Data to be charted. Each row from DATA[ALL] produces a set of bars with the same color or fill pattern. The number of rows in DATA[ALL] determines the number of different colored (patterned) bars in each group.

r0,r1

Range of rows in DATA[ALL] to use for the chart. Used 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 _bar.pub utility uses 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.

xtitle$

Title below the "X" axis. A backslash "\" in XTITLE$ may be used to indicate a new line. Therefore, the X-axis title may be any number of centered lines.

ytitle$

Title on the left of the "Y" axis. A backslash "\" in YTITLE$ may be used to indicate a new line. Therefore, the Y-axis title may be any number of lines. The Y-axis title will be rotated 90 degrees when printed.

xtic$[all]

Individual labels placed along the "X" axis. Because there is a label for each group of bars, _bar.pub will use the C0 and C1 values when accessing XTIC$[ALL]. In other words, XTIC$[C0:C1] will be used. A backslash "\" within a label causes a new line. A label can be any number of lines.

legend$[all]

Chart legend. Because the legend identifies each of the different colors or patterns used for each bar within a group, _bar.pub uses R0 and R1 to access LEGEND$[ALL]. LEGEND$[ALL] should be dimensioned to LEGEND$[R0:R1]. A backslash character in a legend string causes a new line.

maxy

Overrides the Y-axis scale. Normally, _bar.pub will determine the range of Y-axis values (the MAX and MIN value of DATA[R0:R1,C0:C1]). The Y-axis labeled values are automatically determined from this range. However, there are times when an upper scale value of, for example, 100, is desired, though there may not be any bar over 60. In this case, MAXY should be set to 100. If a bar exceeds 100, then MAXY will be overridden. Normally MAXY is set to 0.

options$

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

"S"

Indicates a stacked bar chart instead of the default side-by-side bar chart. In a stacked chart, the Y-axis scale is dependent on the sums of the bars within each group as opposed to the individual values. Also, where many chart programs do not define how negative values affect a stacked chart, _bar.pub will keep separate positive and negative sums and will create a negative stack as well as a positive stack.

title(font,size)

Provides special text style information for the various titles and labels. The title is a code indicating which text, and can be any of the following:

T - main title

X - X-axis title

x - X-axis tic mark labels

Y - Y-axis title

L – 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. An example of OPTION$ for a stacked chart with a double size main title would be:

"S T(0,2)"

See Also

Alphabetical Utilities

Functional Listing of Utilities