Pie Chart

Developer(s): Ryan Gray
Date: 1984
Type: Program
Platform(s): TS 2068
Tags: Business

Prints a user-defined pie chart to the 2040 printer. Requires TASWIDE.

Content

Appears On

This tape is a compilation of programs from user group members (Robert Burton, David Baulch, Frank Bouldin, Chuck Dawson, Ryan

Related Products

Related Articles

Related Content

Image Gallery

Source Code

    1 REM PIE CHART
    2 REM RESET  by Ryan Gray, 9/30/84;  ALL RIGHTS RESERVED
    5 PAPER 0: INK 7: BRIGHT 0: OVER 0: INVERSE 0: FLASH 0: BORDER 0: CLS 
    6 PRINT "CAUTION!  If TASWIDE is NOT               in memory at this               time, BREAK the                 program now and load            TASWIDE then re-RUN             PIE CHART"
    7 PRINT ''"Otherwise press any key..."
    8 PAUSE 0
   10 INPUT "# OF PIECES:";N
   11 IF N<2 THEN STOP 
   20 DIM E(N)
   21 DIM P(N): DIM l$(n,10)
   22 LET t=0: PRINT AT 21,16;"# OF PIECES:";n
   30 FOR A=1 TO N: INPUT "PERCENT FOR #";STR$ A;":";E(A)
   31 LET t=t+e(a): PRINT AT 21,0;"TOTAL:";t;"%   "
   32 INPUT "PULL PIECE? (1/0) ";P(A)
   33 INPUT "LABEL:";l$(a)
   34 NEXT a
   35 FOR a=1 TO n: LET e(a)=INT (e(a)*100+.5)/100: NEXT a
   43 PRINT AT 21,0;"                                "
   44 INPUT "MAIN TITLE:";T$: INPUT "SUB TITLE:";s$
   45 LET A1=0
   46 RANDOMIZE USR 64300: PRINT CHR$ 3;
   50 FOR A=1 TO N: LET A3=PI/50*E(A): LET A2=A1+A3/2
   51 LET g1=COS a2: LET g2=SIN a2: LET h1=COS a1: LET h2=SIN a1: LET i1=COS (a1+a3): LET i2=SIN (a1+a3)
   52 PRINT AT 11-(60+(10 AND P(A)))*g2/8,32+(60+(10 AND P(A)))*g1/4-(9 AND a2>PI/2 AND a2<3*PI/2);A;":";l$(a)
   60 PLOT 132+(10*g1 AND P(A)),83+(10*g2 AND P(A)): DRAW 50*h1,50*h2
   61 PLOT 132+(10*g1 AND P(A)),83+(10*g2 AND P(A)): DRAW 50*i1,50*i2
   62 DRAW 50*h1-50*i1,50*h2-50*i2,-A3
   65 LET A1=A1+A3
   66 REM 
   70 NEXT A
   80 FOR A=1 TO N: PRINT AT A+2,0;A;":";" " AND e(a)<10;E(A);".00" AND e(a)=INT e(a);"0" AND e(a)*10=INT (e(a)*10) AND e(a)<>INT e(a);"%": NEXT A
   90 PRINT AT 1,INT ((64-LEN s$)/2);s$
   91 RANDOMIZE USR 64300: PRINT CHR$ 2;AT 0,INT ((32-LEN T$)/2);T$
  100 INPUT "C to COPY, N for new graph:";n$
  110 IF n$="C" OR n$="c" THEN BEEP .01,0: COPY : BEEP .01,5: GO TO 100
  120 IF n$="N" OR n$="n" THEN RUN 
  130 GO TO 100

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

Scroll to Top