Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/gigi/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\\^\j\n]0^^UYdv\[9\]HOUSEKEEP\f0\hT(BS2)\\\C\=]']]+\=]]\C\ 0]4]A]N\=]>!S\
T(E)p[380,242]c[+200]\\O\+(\+b2\O\\O\I\k\Oodl\`O\`S P\`g\\`t`z 0`wp[380,242]v
aa`~a	a"\aaa"\a.b;\a9!a<aAbbb8 0a>p	a]agaHaaaEaO"7`aLaS"@\%!adan"akar"@\% 0btbb

b/b%b3b\+bb"\O\!y0b:"%"bFcc=\%bP"@bSb|\7bub]bybabj\I\!\%c\%dd\=d\=dd d%dHdM 0d"p	\=d2d/d9"d6d="@\% 0dKtdW\I\ds9duHOUSEKEEPDEFINE PLOT DRAWPIE
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 "T(BS2)"
 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)p[380,242]c[+200]"
 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
		PLOT HOUSEKEEP 2
    END
END_PLOT