Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/pc350/draw_bar.cdd-plot
There are 4 other files named draw_bar.cdd-plot in the archive. Click here to see a list.
{]-"ie]Oa#jW 0]3]20Y_LABEL 0]']80X_LABEL \o],START_BAR \u\tX_POS \z\yY_POS ]\ZERO ]]INDEX ]]
STOP]]NEXT]]CNT]]MAXSTR ]!]>DIAG \@]&SHADOW2\F\DXAXIS\L\JYAXIS\R\PXLENGTH\X\VYLENGTH\^\\MINVALUE \d\bMAXVALUE \i\hWIDTH \!\nSHADOW \0\& \'VALUESP \
\@]p!y\L^"R`\F^"6@\R^"5p]-]?
]D]\!]]J]0] \
]:D\
hual]e x t\Ly!``	]| 0]3` 0` \X`%	\!\^`9	\!`H`Y`o`L`V\! x\d`h
\L`l!\d`
\Laaaaa
 P\! 0jL
a+bazb<bPbUccc5cbcpdirivjHa'9a)HOUSEKEEPa/0\@\F\L\R]3]-9a1LABELbb\Xb	\Xb	b!\X\^9b#LABEL		bB\z9bDLABEL]bf\!bpc\0]\!]c
\09c
LABEL]c.]c2xc:cM]cC\0]cW\0]clcudd
0d]d#]ie]d' 0	d1dHdzee.eSfIfpg3hFhNi`]d@]dD 0\odX\@da\ddr
dhdvde] P 0\ue
\0]\ie%
\de)
 Xe2eB\z\F\z\FeWe{\ieg
\zeq\0]ff$\if
f\z\0]\if3
\zf>\0]fNf[\ifX
\ife
\i
ftgg"\zg\0]]!g\i
]!\i
g8gEg[]!gB]'gT\zgX P]'\zgngshh
hh h+h0hA 0gpP	\o]' 0h(B)W(I(C)S1)P	\o\u 0hV(BW(E))	\d
 0h-(B)V
\i]!
0hDW(S0)P(E)V(E)(E)hShohoi\@hx\di	
hi P ii pi$\
i.i2iHiL 0i1P	\oiA\FiE! 0iKW(I(W))tiV\
io 0iqT(E)i{j?]j\0jjj; 0jp	j'j4jj+\@\L!v@\Fj8!^ 0j=T"(More...)"jD9jFHOUSEKEEPk
j[kk]je\!\
k9kDRAW_BARDEFINE PLOT DRAW_BAR
DECLARE STRING VECTOR STRINGS
DECLARE REAL VECTOR VALUES, SCALED_VALUES
	(DECLARE X_AXIS, Y_AXIS, X_LENGTH, Y_LENGTH, MIN_VALUE, MAX_VALUE, WIDTH, SHADOW
&DECLARE X_POS, Y_POS, ZERO, INDEX, STOP, NEXT, CNT, MAX_STR, DIAG, SHADOW2
	DECLARE START_BAR
DECLARE STRING Y_LABEL, X_LABEL
	! Get data points

ENTRY 0 (X_LBL: STRING,
		 Y_LBL: STRING,

	 STRS : STRING VECTOR,
	 VALS : REAL VECTOR)
    BEGIN
		X_LABEL = X_LBL
	X_AXIS = 100
	X_LENGTH = 600
	Y_AXIS = 360
	Y_LENGTH = 350
		Y_LABEL = Y_LBL

	INCR CNT OVER STRS
	    BEGIN
		STRINGS (CNT) = STRS (CNT)
		VALUES (CNT)  = VALS (CNT)
		IF LENGTH (STRINGS(CNT)) GT MAX_STR
		    MAX_STR = LENGTH (STRINGS (CNT))
	    END
	IF MAX_STR * 6 + 5 GT X_LENGTH / 9
	    BEGIN
		DIAG = 1
		X_LABEL = " "
	    END
IN (VALUES)
(VALUES)

	IF SIZE (VALUES) GE 6
	    THEN WIDTH = X_LENGTH / 13
	    ELSE WIDTH = X_LENGTH / (2 * SIZE(VALUES) + 1)
    END
ENTRY 2
    BEGIN
		PLOT HOUSEKEEP 0
#	PLOT LABEL 0 (X_AXIS, Y_AXIS, X_LENGTH, Y_LENGTH, X_LABEL, Y_LABEL)
	IF MIN_VALUE GT 0 THEN MIN_VALUE = 0
        PLOT LABEL 3 (MIN_VALUE, MAX_VALUE)
	PLOT LABEL 15 (ZERO)
	INCR CNT OVER VALUES
	    SCALED_VALUES (CNT) = VALUES (CNT)
	PLOT LABEL 8 (SCALED_VALUES)
		STOP = NEXT + 6
	IF STOP GT SIZE (SCALED_VALUES)
	    STOP = SIZE (SCALED_VALUES)
	INDEX = 0
	IF DIAG EQ 0

	    THEN PRINT "T(B)"
	    ELSE PRINT "T(B)[10,2]"
	INCR NEXT FROM NEXT + 1 TO STOP
	    BEGIN

		INDEX = INDEX + 1
		X_POS = X_AXIS + WIDTH * (2 * INDEX - 1)
		Y_POS = SCALED_VALUES (NEXT)
		SHADOW = WIDTH / 3
IS THEN

		    ZERO = Y_AXIS
		IF SHADOW GE ZERO - SCALED_VALUES (NEXT) THEN
		   IF SHADOW GE SCALED_VALUES (NEXT) - ZERO THEN
			SHADOW = ZERO - SCALED_VALUES (NEXT)
		IF SHADOW < 0 THEN SHADOW = - SHADOW
		IF ZERO LT SCALED_VALUES (NEXT)
		    THEN SHADOW2 = - SHADOW
		    ELSE SHADOW2 = SHADOW
			IF SHADOW2 > 0
		    THEN START_BAR = ZERO - 2
		    ELSE START_BAR = ZERO
		PRINT "P", LXY (X_POS, START_BAR), "(B)W(I(C)S1)P",
OS, YPOS),
		    "V(BW(E))", RX (WIDTH), "(B)V", RXY (SHADOW, SHADOW2),
(E)(E)"
		IF DIAG EQ 0
		    THEN X_POS = X_AXIS + (WIDTH * (2 * INDEX - .5)) - 4
			     * LENGTH (STRINGS (NEXT))
		PRINT "P",LXY (X_POS, Y_AXIS + 15), "W(I(W))t",
		    QUOTE (STRINGS(NEXT))
	    END
	PRINT "T(E)"
	IF NEXT LT SIZE (SCALED_VALUES)
	    PRINT "p", LXY (X_AXIS + X_LENGTH - 90, Y_AXIS + 60),

		"T""(More...)"""
		PLOT HOUSEKEEP 2
    END
! Re-sort data by height and replot
ENTRY 3
    BEGIN
	NEXT = 0
	SORT DESC (VALUES, STRINGS)
		PLOT DRAW_BAR 2
    END
END_PLOT