Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/vt240/draw_pie.cdd-plot
There are 4 other files named draw_pie.cdd-plot in the archive. Click here to see a list.
{\
ie\U\\ANGLE\%\#DELTAANGLE\+\)LABELANGLE\1\0VTOTAL\7\6STRSLEN\=\<OFFSET\\^\k\t\~]	]]]!]c^3^89=`
`e,e3\[9\]HOUSEKEEP\f 0	\h@:YS(M1(L0))@;@:C@;\p 0\sL(A1)\y 0
\|L"X"FFFFFFFFFFFFFFFF] 0
]L"Y"FFFFFFFFFFFFFFFF] 0
]L"Z"FFFFFFFFFFFFFFFF]0]@:AT(BS2)\]2\C\=]Z]B]^\=]F]P\C\ 0]g]t^\=]q!S\
\=!S!^"^'0^$P	\\1^q^Y^u\1^]^g\C\0^~'\1!S\O\I\`"\O`&e!
 P\a\\a+a1 0a-p[380,242]v
a;aOa5a?a8"\aHaSaL"\aebq\ao!arawb4b9bm 0aup	bbbba{b"7`bb"@\%!bb&"b#b*"@\% 0b6tb<b@
beb[bibT\+bIbX\O\!y  0bp "%"b{cIcs\%c"@c	c1\7c*cc.cc \I\!\%cB\%cF XcNc[\7cX\%cl\%cp Xc|e\d |d	d5e\=d+d\7dd"7`dd!"@\%d:dG\=dD\=dQdUdZd~e 0dXp	\=dgdddn"dkdr"@\% 0ete
\I\e( 0e+@;@Ae09e2HOUSEKEEPDEFINE PLOT DRAW_PIE
DECLARE X_POS, NUMBER
%DECLARE ANGLE, DELTA_ANGLE, LABEL_ANGLE, VTOTAL, STR_LEN, OFFSET, MAX_LEN
ENTRY 0 (TITLES : STRING VECTOR,
	 STRINGS : STRING VECTOR,

	 VALUES : REAL VECTOR)
    BEGIN
		PLOT HOUSEKEEP 0
	PRINT "@:YS(M1(L0))@;@:C@;"
	PRINT "L(A1)"
	PRINT "L""X""FFFFFFFFFFFFFFFF"
	PRINT "L""Y""FFFFFFFFFFFFFFFF"
	PRINT "L""Z""FFFFFFFFFFFFFFFF"

	PRINT "@:AT(BS2)"
VER TITLES
	    MAX_LEN = MAX_LEN + LENGTH (TITLES(NUMBER)) + 1
#	IF MAX_LEN > 38 THEN X_POS = 0 ELSE X_POS =     (38 - MAX_LEN) * 10
	PRINT "P", LXY (X_POS, 0)
R TITLES
	    BEGIN
		STR_LEN = STR_LEN + LENGTH (TITLES(NUMBER)) + 1
 		IF     (STR_LEN < 38) THEN PRINT "T""", TITLES(NUMBER)," """
	    END
	PRINT "T(E)T(A1)p[380,242]c(w(rs""Z""i1))[+200]c[+200]T(A0)"
R VALUES
	    VTOTAL = VTOTAL + VALUES(NUMBER)
	SORT DESCENDING (VALUES, STRINGS)
VALUES
	  IF VALUES(NUMBER) NE 0 THEN
	    BEGIN
		DELTA_ANGLE = 360 * VALUES(NUMBER)/VTOTAL
		LABEL_ANGLE = ANGLE + DELTA_ANGLE/2
		ANGLE = ANGLE + DELTA_ANGLE
!		PRINT "p[380,242]v", RXY(-200 * SIN(ANGLE), -200 * COS(ANGLE))
		IF DELTA_ANGLE > 15
		    PRINT "p", LXY (380 - 140 * SIN(LABEL_ANGLE) - 15,
		    		    240 - 140 * COS(LABEL_ANGLE)), "t",
			QUOTE(CVT(INT(VALUES(NUMBER) * 100/VTOTAL+.5)))," ""%"""

		IF LABEL_ANGLE < 180
			    THEN BEGIN
			OFFSET = - LENGTH (STRINGS(NUMBER)) * 9
			LABEL_ANGLE = LABEL_ANGLE - 3
		    END
			    ELSE BEGIN
			OFFSET = 0
			LABEL_ANGLE = LABEL_ANGLE + 3
		    END
		IF DELTA_ANGLE > 7
		  BEGIN
		    MAX_LEN = 380 - 220 * SIN(LABEL_ANGLE) + OFFSET
		    IF MAX_LEN < 0 THEN MAX_LEN = 0
		    PRINT "p",LXY(MAX_LEN,
			240 - 220 * COS(LABEL_ANGLE)),
			"t", QUOTE (STRINGS(NUMBER))
		  END
	    END
	PRINT "@;@A"
		PLOT HOUSEKEEP 2
    END
END_PLOT