Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/vt100/draw_pie.cdd-plot
There are 4 other files named draw_pie.cdd-plot in the archive. Click here to see a list.
{\
ie\h\\X\#\"Y\)\(XL\.\-YL\4\3NUMBER\:\9Y\POS\@\>DELTAY \F\DVTOTAL \K\JCNT \Q\PWIDTH \
	\q\}]]m]q^^
^^(^6q,+@\n9\pHOUSEKEEP\y0\{\.]f\V]a]]W]]>]]4!p]]8]*\V\.P];]Hx\.]LP\V\.]j0]l\]{!\^	0\#^!Q@\)^$!8\^2 0^4\
!6\:!:!C!P\:!MP\:!ZP!c!p\Q!m!6\:!z\Q$\Q\:$$*%	%\\# P% 0%q%" 0%%%3+/\:%= 0%g* *$+++%@%J%V\%N |\Q%`\:%d P%k*%o
**
**\@%x%}\b\.!y  0*%  \K*\*D*`*=*H*3*A\#\!*Q\\\. P*d*u+*n\K\*r!\Q+\:+ P+ \\\.+=9+?HOUSEKEEPDEFINE PLOT DRAW_PIE
AB, XLAB
'DECLARE REAL	X, Y, XL, YL, NUMBER, Y_POS, DELTA_Y, VTOTAL, CNT, WIDTH, I_POS
ENTRY 0 (TITLES : STRING VECTOR,
	 STRINGS : STRING VECTOR,

	 VALUES : REAL VECTOR)
    BEGIN
		PLOT HOUSEKEEP 0
	! Titles
	PRINT ""
 TITLES
	    BEGIN
		PRINT TXY(65 - LENGTH(TITLES(NUMBER)) / 2,6 + NUMBER * 2),
		    TITLES(NUMBER)
	    END
	PRINT ""
	! Draw the box
	X = 10 Y = 1 XL = 35 YL = 24 XLAB = "" YLAB = ""
	PLOT LABEL 0 (X,Y,XL,YL,XLAB,YLAB)
	! Look at the values
R VALUES
	    VTOTAL = VTOTAL + VALUES(NUMBER)
	PRINT TXY(55,20),"Total:",TXY(63,20),CVT(VTOTAL)
	SORT DESCENDING (VALUES, STRINGS)
	Y_POS = 1
	I_POS = 1
 VALUES
	  IF VALUES(NUMBER) NE 0 THEN
	    BEGIN
		DELTA_Y = 22 * VALUES(NUMBER)/VTOTAL
S + DELTAY
		DELTA_Y = INT(DELTA_Y + .5)
		IF DELTA_Y < 2 THEN DELTA_Y = 2
		IF I_POS > 22 THEN DELTA_Y = 0 
S + DELTAY
		IF I_POS EQ 23 THEN I_POS = 24
		IF DELTA_Y > 0 THEN
		    BEGIN
			PRINT TXY(X+1,I_POS), ""
			INCR CNT FROM X + 1 TO X + XL - 2
				    PRINT "q"
			PRINT ""
		    END
		IF DELTA_Y > 1 THEN
		    BEGIN
			PRINT TXY(X + 7,I_POS - DELTA_Y / 2)
			PRINT CVT(INT(VALUES(NUMBER) * 100/VTOTAL+.5)),"%  "
			WIDTH =   (XL - X - 10 - LENGTH(STRINGS(NUMBER)) ) / 2
			PRINT TXY(X + 13 + WIDTH, I_POS - DELTA_Y / 2)
		        PRINT STRINGS(NUMBER)
		    END
	    END
		PLOT HOUSEKEEP 2
    END
END_PLOT