Chapter 10: Business Graphics
This chapter presents business graphic routines to create bar graphs
and pie charts.
B A R S
BARS plots bar graphs.
- The call is:
- CALL BARS (XRAY, Y1RAY, Y2RAY, N) - level 2, 3
- XRAY
- is an array of user coordinates defining
the position of the bars on the X-axis.
- Y1RAY
- is an array of user coordinates containing the
start points of the bars on the Y-axis.
- Y2RAY
- is an array of user coordinates containing the
end points of the bars on the Y-axis.
- N
- is the number of bars.
Additional notes:
- Shading patterns of bars can be selected
with SHDPAT or MYPAT. Shading
numbers will be incremented by 1 after every call to
BARS.
- Legends can be plotted for bar graphs.
The following routines modify the appearance of bar graphs.
B A R T Y P
The routine BARTYP defines vertical or horizontal bars.
- The call is:
- CALL BARTYP (CTYP) - level 1, 2, 3
- CTYP
- is a character string defining the bar type.
- = 'VERT'
- means that vertical bars will be plotted.
- = 'HORI'
- means that horizontal bars will be plotted.
If this parameter is used,
XRAY defines the position of the bars on the Y-axis while
Y1RAY and Y2RAY define the position of the bars on the X-axis.
- = '3DVERT'
- defines vertical 3-D bars.
- = '3DHORI'
- defines horizontal 3-D bars.
Default: CTYP = 'VERT'.
B A R W T H
BARWTH defines the width of the bars.
- The call is:
- CALL BARWTH (XWTH) - level 1, 2, 3
- XWTH
- is a real number defining the width. If XWTH is
positive, the bar width is the absolute value of
XWTH * (XRAY(1)-XRAY(2)).
If XWTH is negative, the absolute value of XWTH
is used where XWTH must be specified in plot
coordinates.
Default: XWTH = 0.75
B A R M O D
BARMOD modifies the width of bars.
- The call is:
- CALL BARMOD (CMOD, COPT) - level 1, 2, 3
- COPT
- is a character string that can have the values
'FIXED' and 'VARIABLE'. If CMOD = 'VARIABLE', the width
of bars plotted by the routine BARS will be variable.
In that case, XWTH should have a positive value in
BARWTH since the width of bars is calculated in a
simular way as described in BARWTH.
- COPT
- is a character string that must contain the value
'WIDTH'.
Default: ('FIXED', 'WIDTH').
B A R P O S
The position of the bars is determined by the parameters
XRAY, Y1RAY and Y2RAY. The routine BARPOS can be used to select predefined
positions. The parameters XRAY, Y1RAY and Y2RAY will contain the calculated
positions.
- The call is:
- CALL BARPOS (COPT) - level 1, 2, 3
- COPT
- is a character string that defines the position of the
bars.
- = 'NONE'
- means that the positions are defined
only by the parameters in BARS.
- = 'TICKS'
- means that the bars will be centred
at major ticks. XRAY must be a dummy vector.
- = 'AXIS'
- means that vertical bars start
at the X-axis and horizontal bars at the
Y-axis. Y1RAY must be a dummy vector.
- = 'BOTH'
- activates the options 'TICKS' and
'AXIS'. XRAY and Y1RAY must be dummy arrays.
Default: COPT = 'NONE'.
Bars can be plotted on top of one another if the routine BARS is called
several times.
To plot bars side by side in groups, the routine BARGRP can be used.
B A R G R P
The routine BARGRP puts bars with the same axis position into
groups. The number of group elements should be the same as the number
of calls to the routine BARS.
- The call is:
- CALL BARGRP (NGRP, GAP) - level 1, 2, 3
- NGRP
- is the number of bars defining one group.
- GAP
- defines the spacing between group bars. If GAP
is positive, the value GAP * W is used where W is the
width of a single bar.
If GAP is negative, the positive value of GAP is used
where GAP must be specified in plot coordinates.
B A R C L R
The routine BARCLR defines the colours of bars. Different colours can be
defined for the sides of 3-D bars.
- The call is:
- CALL BARCLR (IC1, IC2, IC3) - level 1, 2, 3
- IC1, IC2, IC3
- are colour numbers between -1 and 255 for the
front, side and top planes of 3-D bars. The value -1 means
that the corresponding plane is plotted with the current colour.
Default: (-1, -1, -1).
B A R B O R
The routine BARBOR defines the colour of borders plotted around the bars.
By default, a border in the current colour is plotted around 2-D bars, and
borders in the foreground colour are plotted around 3-D bars.
- The call is:
- CALL BARBOR (IC) - level 1, 2, 3
- IC
- is a colour number between -1 and 255.
Default: IC = -1
B A R O P T
The routine BAROPT modifies the appearance of 3-D bars.
- The call is:
- CALL BAROPT (XF, ANG) - level 1, 2, 3
- XF
- is a floatingpoint number that defines the depth of bars.
IF XF = -1., the bar width is used for the bar depth.
IF XF > 0., XF is interpreted as the bar depth specified
in plot coordinates.
- ANG
- defines an angle measured in degrees between the front
and side planes of 3-D bars.
Default: (-1., 45.).
L A B E L S
The routine LABELS defines labels for bar graphs.
- The call is:
- CALL LABELS (CLAB, 'BARS') - level 1, 2, 3
- CLAB
- is a character defining the labels.
- = 'NONE'
- means that no labels will be
plotted.
- = 'SECOND'
- means that Y2RAY is used for labels.
- = 'FIRST'
- means that Y1RAY is used for labels.
- = 'DELTA'
- means that the difference vector
(Y2RAY - Y1RAY) is used for labels.
Default: CLAB = 'NONE'.
L A B P O S
The routine LABPOS defines the position of the labels.
- The call is:
- CALL LABPOS (CPOS, 'BARS') - level 1, 2, 3
- CPOS
- is a character string that defines the position
of the labels.
- = 'INSIDE'
- means inside at the end of a bar.
- = 'OUTSIDE'
- means outside at the end of a bar.
- = 'LEFT'
- defines the upper left side.
- = 'RIGHT'
- defines the upper right side.
- = 'CENTER'
- selects the centre of a bar.
- = 'AUTO'
- means 'INSIDE' if
labels are smaller than the bar width, otherwise
'OUTSIDE'.
Default: CPOS = 'AUTO'.
L A B D I G
The routine LABDIG defines the number of decimal places in the labels.
- The call is:
- LABDIG (NDIG, 'BARS') - level 1, 2, 3
- NDIG
- is the number of decimal places (>= -1).
Default: NDIG = 1
L A B C L R
The routine LABCLR defines the colour of labels.
- The call is:
- CALL LABCLR (NCLR, 'BARS') - level 1, 2, 3
- NCLR
- is a colour number between -1 and 255. If NCLR = -1,
the bar labels will be plotted with the current
colour.
Default: NCLR = -1
P I E G R F
PIEGRF plots pie charts.
- The call is:
- CALL PIEGRF (CBUF, NLIN, XRAY, NSEG) - level 1
- CBUF
- is a character string containing text lines for segment
labels. More than one line can be defined for labels.
CBUF must be created with LEGLIN after calling LEGINI.
If NLIN is 0 in the parameter list, CBUF can be a
dummy variable.
- NLIN
- is the number of text lines used for one segment label.
- XRAY
- is an array of user coordinates.
- NSEG
- is the dimension of XRAY.
Additional notes:
- The centre and the size of pies
is defined by a region that can be changed with the
routines AXSPOS and AXSLEN.
- PIEGRF sets the level to 2. Titles and
legends can be plotted after PIEGRF is called.
- Segment labels can contain several lines of text
and the data values specified in PIEGRF. Data values
can also be converted to percent values.
- Segment labels are contained within a box where the
thickness of the border can be changed with FRAME.
The following routines modify the appearance of pie charts.
P I E T Y P
The routine PIETYP defines 2-D or 3-D pie charts.
- The call is:
- CALL PIETYP (CTYP) - level 1, 2, 3
- CTYP
- is a character string defining the pie type.
- = '2D'
- defines a 2-D pie chart.
- = '3D'
- defines a 3-D pie chart.
Default: CTYP = '2D'.
C H N P I E
CHNPIE defines colours and shading patterns for pie graphs.
- The call is:
- CALL CHNPIE (CATT) - level 1, 2, 3
- CATT
- is a character string defining segment attributes.
- = 'NONE'
- means that all pie segments will be
plotted with the current colour and shading
pattern.
- = 'COLOR'
- means that every segment will have
a different colour.
- = 'PATTERN'
- means that every segment will have
a different shading pattern.
- = 'BOTH'
- means that every segment will have both
a different colour and shading pattern.
Default: CATT = 'PATTERN'.
- Additional note:
- The sequence of colours is: WHITE/BLACK,
RED, GREEN,
YELLOW, BLUE, ORANGE, CYAN, MAGENTA.
The sequence of shading patterns is 0 - 17.
Colour and pattern cycles can be changed with
CLRCYC and PATCYC.
L A B E L S
LABELS selects data or percent values used for segment labels.
- The call is:
- CALL LABELS (CLAB, 'PIE') - level 1, 2, 3
- CLAB
- is a character string that defines the values used for
segment labels.
- = 'NONE'
- means that data values will not
be displayed.
- = 'PERCENT'
- means that values will be plotted
as percentages.
- = 'DATA'
- means that the data values specified
in PIEGRF will be plotted.
- = 'BOTH'
- means both 'PERCENT' and 'DATA'.
Default: CDOC = 'PERCENT'.
L A B P O S
LABPOS determines the position of segment labels.
- The call is:
- CALL LABPOS (CPOS, 'PIE') - level 1, 2, 3
- CPOS
- is a character string defining the position of labels.
- = 'INTERNAL'
- means that labels will be
plotted inside pie segments. If labels are too big,
they will be plotted outside.
- = 'EXTERNAL'
- means that segment labels will
be plotted outside pie segments.
- = 'ALIGNED'
- means that segment labels will be
plotted outside pie segments and aligned.
Default: CPOS = 'INTERNAL'.
L A B T Y P
LABTYP defines the position of text lines in segment labels.
- The call is:
- CALL LABTYP (CTYP, 'PIE') - level 1, 2, 3
- CTYP
- is a character string that defines how
text lines are justified.
- = 'CENTER'
- centres text lines.
- = 'LEFT'
- left-justifies text lines.
- = 'RIGHT'
- right-justifies text lines.
- = 'OUTWARDS'
- left-justifies text lines on the left
side of pies and right-justifies text lines on the right
side of pies.
- = 'INWARDS'
- right-justifies text lines on the left
side of pies and left-justifies text lines on the right
side of pies.
Default: CTYP = 'CENTER'.
L A B D I G
The routine LABDIG defines the number of decimal places used in
segment labels.
- The call is:
- CALL LABDIG (NDIG, CDIG) - level 1, 2, 3
- NDIG
- is the number of decimal places (>= -1).
- CDIG
- is a character string selecting the data values.
- = 'PIE'
- defines the number of decimal places
used for percent and data values.
- = 'PERCENT'
- defines the number of decimal places
used for percent values.
- = 'DATA'
- defines the number of decimal places
used for data values.
Default: (1, 'PIE').
L A B C L R
The routine LABCLR defines the colour of labels.
- The call is:
- CALL LABCLR (NCLR, 'PIE') - level 1, 2, 3
- NCLR
- is a colour number between -1 and 255. If NCLR = -1,
the pie labels will be plotted with the current
colour.
Default: NCLR = -1
P I E C L R
The routine PIECLR defines colours for single pies. Different colours can be
defined for the top and front sides of 3-D pies. PIECLR has no effect if
the routine CHNPIE is called with the parameters 'COLOR' or 'BOTH'.
- The call is:
- CALL PIECLR (NC1RAY, NC2RAY, N) - level 1, 2, 3
- NC1RAY, NC2RAY
- are integer arrays containing colour numbers
between -1 and 255 for the top and front sides of pies. The value -1
means that the current colour is used.
- N
- is the dimension of NC1RAY and NC2RAY.
P I E B O R
The routine PIEBOR defines the colour of borders plotted around the pies.
By default, a border in the current colour is plotted around 2-D pies, and
borders in the foreground colour are plotted around 3-D pies.
- The call is:
- CALL PIEBOR (IC) - level 1, 2, 3
- IC
- is a colour number between -1 and 255.
Default: IC = -1
P I E O P T
The routine PIEOPT modifies the appearance of 3-D pies.
- The call is:
- CALL PIEOPT (XF, ANG) - level 1, 2, 3
- XF
- is a scaling number that defines the thickness of pies.
The thickness is set to XF * radius.
- ANG
- defines an view angle measured in degrees.
Default: (0.2, 45.).
P I E L A B
The routine PIELAB defines character strings that can be plotted
on the left or right side of data values within segment labels.
- The call is:
- CALL PIELAB (CLAB, CPOS) - level 1, 2, 3
- CLAB
- is a character string displayed in segment labels.
- CPOS
- is a character string that defines the position of
CLAB.
- = 'LEFT'
- means that CLAB will be plotted
on the left side of data values.
- = 'RIGHT'
- means that CLAB will be plotted on
the right side of data values.
- Additional note:
- If percent and data values are plotted in
segment labels, PIELAB is only used for data
values.
P I E E X P
Pie segments will be offset by 8% of the radius if PIEEXP is called.
- The call is:
- CALL PIEEXP - level 1, 2, 3
- Additional note:
- Single segments will be offset if the
corresponding values in PIEGRF are negative.
P I E V E C
PIEVEC modifies the arrows plotted between segments and labels that lie
outside of segments.
- The call is:
- CALL PIEVEC (IVEC, COPT) - level 1, 2, 3
- IVEC
- defines the arrow head (see VECTOR).
- COPT
- is a character string that defines the vector
plotted between segments and labels.
- = 'NONE'
- suppresses vectors.
- = 'STRAIGHT'
- means that straight vectors will
be plotted.
- = 'BROKEN'
- means that broken vectors will
be plotted.
Default: (2301, 'BROKEN').
U S R P I E
USRPIE is a user-defined subroutine that can modify
pie charts such as suppressing certain labels. USRPIE is called
by PIEGRF for each segment.
- The call is:
- CALL USRPIE (ISEG, XDAT, XPER, NRAD, NOFF, ANGLE,
NVY, IDRW, IANN) - level 1, 2, 3
- ISEG
- is the segment index (starting with 1).
- XDAT
- is the data value of the segment as specified in PIEGRF.
- XPER
- is the percent value of XDAT.
- NRAD
- is the segment radius in plot coordinates.
- NOFF
- is the segment offset in plot coordinates (default: 0).
- ANGLE
- is the offset angle measured in degrees in a
counter-clockwise direction. The default value is
the angle which bisects the segment.
- NVY
- shifts the segment label in the Y-direction by
NVY plot coordinates.
- IDRW
- defines the plotting of segments. If IDRW = 0,
plotting will be suppressed (default: 1).
- IANN
- defines the plotting of labels. If IANN = 0,
labels will be suppressed (default: 1).
- Additional note:
- The first 3 parameters of USRPIE are only
given for information and cannot be changed
by the user.
Next |
Previous |
Contents