This program will make up to and including 18 slices. It also displays a slice number, the value you input and the % of the whole.
1 RUN 400: REM for pie chart with up to 18 pieces of pie
240 FOR r=1 TO ra STEP RND*6+.7: FOR p=as TO ae STEP d*(40/r): PLOT r*COS p+xc,r*SIN p+yc: NEXT p: NEXT r: RETURN
399 REM add a "'" for N$ for each name line over 1. Normal is 2 for 1 line.
400 INPUT "PIE CHART NAME? ";N$: CLS : PRINT N$'''"# val r%": INPUT "how many divisions? ";div
401 LET total=0: DIM d(div)
402 FOR a=1 TO div: INPUT "enter value for division #";(a);" ";d(a): LET total=total+d(a): PRINT a;TAB 3;d(a): NEXT a
1100 LET xc=168: LET yc=88: LET ra=87: CIRCLE xc,yc,ra
1200 LET ang=0: FOR s=1 TO div
1400 PRINT AT s+2,8;INT (d(s)/total*100+.5)
2050 LET d=(RND*6+.7)*.01745
2200 LET as=ang*.01745
2210 PLOT xc,yc: DRAW ra*COS as,ra*SIN as
2222 LET ang=ang+d(s)/total*360
2300 LET ae=ang*.01745
2400 GO SUB 240
2440 NEXT s
3000 PRINT TAB 2;"_____": PRINT TAB 2;total;AT 10,30; INVERSE 1;1;AT 11,30;div
3100 REM add necessary LPRINTs to describe item #s within space.
3333 STOP
9999 SAVE "piechart"

Reprinted from the October/87 issue of the Plotter
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.