--- title: "Pie Chart Graph and Display" id: 76563 type: "computer_media" slug: "pie-chart-graph-and-display" url: "http://localhost/computer_media/pie-chart-graph-and-display/" markdown_url: "http://localhost/computer_media/pie-chart-graph-and-display.md" published_at: "2026-11-11T08:02:23+00:00" modified_at: "2026-11-11T08:02:23+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/pie-chart-graph-and-display-1.png" excerpt: "Draw a pie chart of up to ten categories on the ZX81 screen from your own data, followed by a table of amounts and percentages." post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 1000" slug: "ts1000" taxonomy: "post_tag" url: "http://localhost/tag/ts1000/" - name: "ZX81" slug: "zx81" taxonomy: "post_tag" url: "http://localhost/tag/zx81/" model: - name: "Sinclair ZX81" slug: "zx81" taxonomy: "model" url: "http://localhost/model/zx81/" - name: "Timex/Sinclair 1000" slug: "ts-1000" taxonomy: "model" url: "http://localhost/model/ts-1000/" indiv: - name: "Ron Oblander" slug: "ron-oblander" taxonomy: "indiv" url: "http://localhost/indiv/ron-oblander/" genre: - name: "Graphics" slug: "graphics" taxonomy: "genre" url: "http://localhost/type/graphics/" media_type: "Program" programmers: - name: "Ron Oblander" slug: "ron-oblander" taxonomy: "indiv" url: "http://localhost/indiv/ron-oblander/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Pie%20Chart%20Graph%20and%20Display%20%281982%29%28Oblander%2C%20Ron%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1982" images: - url: "http://localhost/wp-content/uploads/2026/11/pie-chart-graph-and-display-1.png" - url: "http://localhost/wp-content/uploads/2026/11/pie-chart-graph-and-display-2.png" - url: "http://localhost/wp-content/uploads/2026/11/pie-chart-graph-and-display-3.png" article_media: - id: 19357 title: "Pie Chart Graph and Display" type: "article" url: "http://localhost/article/pie-chart-graph-and-display/" related_content: - id: 19585 title: "Pie Chart: A Refinement" type: "article" url: "http://localhost/article/pie-chart-a-refinement/" media_type_tags: "Graphics" license: false --- # Pie Chart Graph and Display Answer Y or N to IS PRINTED OUTPUT DESIRED?, then enter the number of categories and a title (up to 10 characters) and value for each. After the total, press ENTER: the program draws the circle and the radii between the segments with PLOT and numbers them, shows the chart for a few seconds, then lists each category with its amount and percentage. With Y it COPYs the chart and the table to the printer. It needs 16K. In November 1983 Syntax printed a rewritten pie chart program by John Pazmino. Published in Syntax November 1982 ([Pie Chart Graph and Display](https://timexsinclair.com/article/pie-chart-graph-and-display/)). ## Source Code ``` 1 REM PIE 2 PRINT AT 20,0;"PROGRAM TO DRAW A PIE CHART FOR UP TO TEN CATEGORIES" 3 SCROLL 4 PRINT "IS PRINTED OUTPUT DESIRED?" 5 SCROLL 6 PRINT "ENTER Y/N--"; 7 INPUT A$ 8 PRINT A$ 16 SCROLL 20 PRINT "ENTER NUMBER OF CATEGORIES--"; 21 INPUT C 22 PRINT C 23 DIM E(C) 24 DIM C$(C,10) 25 FOR D=1 TO C 26 SCROLL 27 PRINT "ENTER TITLE OF CATEGORY ";D 28 INPUT C$(D) 29 SCROLL 30 PRINT C$(D) 36 SCROLL 41 PRINT "ENTER VALUE FOR CATEGORY ";D;"--"; 42 INPUT E(D) 43 SCROLL 44 PRINT E(D) 49 NEXT D 50 LET T=0 55 FOR F=1 TO C 57 LET T=T+E(F) 59 NEXT F 60 SCROLL 61 PRINT "TOTAL AMOUNT IS ";T 62 SCROLL 63 SCROLL 64 PRINT "PRESS ENTER TO CONTINUE" 65 INPUT B$ 70 FOR G=1 TO 22 75 SCROLL 80 NEXT G 85 CLS 100 REM CIRCLE 105 PLOT 31,21 110 LET RADS=21 120 FOR P=0 TO 90 STEP 2 130 LET RADN=.017453*P 140 LET A=SIN RADN*RADS 150 LET B=COS RADN*RADS 160 PLOT (31+B),(21+A) 170 PLOT (31-B),(21+A) 180 PLOT (31-B),(21-A) 190 PLOT (31+B),(21-A) 200 NEXT P 210 DIM S(C) 215 DIM Z(C) 220 FOR X=1 TO C 230 LET S(X)=E(X)/T 235 NEXT X 240 FOR L=0 TO RADS 250 PLOT 31,(21+L) 260 NEXT L 270 FOR Y=1 TO C 280 LET Z(Y)=S(Y)*360*.017453 290 NEXT Y 400 DIM W(C) 403 LET W(1)=Z(1) 405 FOR Y=2 TO C 410 LET W(Y)=Z(Y)+W(Y-1) 420 NEXT Y 440 GOTO 800 450 FOR Y=1 TO C-1 460 IF W(Y)>=0 AND W(Y)<=.5*PI THEN GOTO 650 470 IF W(Y)>.5*PI AND W(Y)<=PI THEN GOTO 600 480 IF W(Y)>PI AND W(Y)<=1.5*PI THEN GOTO 550 500 LET W(Y)=2*PI-W(Y) 510 FOR L=0 TO RADS 520 PLOT 31-SIN W(Y)*L,21+COS W(Y)*L 530 NEXT L 540 GOTO 680 550 LET W(Y)=W(Y)-PI 560 FOR L=0 TO RADS 570 PLOT 31-SIN W(Y)*L,21-COS W(Y)*L 580 NEXT L 590 GOTO 680 600 LET W(Y)=PI-W(Y) 610 FOR L=0 TO RADS 620 PLOT 31+SIN W(Y)*L,21-COS W(Y)*L 630 NEXT L 640 GOTO 680 650 FOR L=0 TO RADS 660 PLOT 31+SIN W(Y)*L,21+COS W(Y)*L 670 NEXT L 680 NEXT Y 685 FOR Y=1 TO C 690 IF U(Y)>=0 AND U(Y)<=.5*PI THEN GOTO 750 695 IF U(Y)>.5*PI AND U(Y)<=PI THEN GOTO 735 700 IF U(Y)>PI AND U(Y)<=1.5*PI THEN GOTO 720 705 LET U(Y)=2*PI-U(Y) 710 PRINT AT 11-COS U(Y)*10,15-SIN U(Y)*10;Y 715 GOTO 752 720 LET U(Y)=U(Y)-PI 725 PRINT AT 11+COS U(Y)*10,15-SIN U(Y)*10;Y 730 GOTO 752 735 LET U(Y)=PI-U(Y) 740 PRINT AT 11+COS U(Y)*10,15+SIN U(Y)*10;Y 745 GOTO 752 750 PRINT AT 11-COS U(Y)*10,15+SIN U(Y)*10;Y 752 NEXT Y 753 PRINT AT 11,15;"*" 755 GOTO 900 800 REM MARKING OF SEGMENTS 810 DIM U(C) 820 LET U(1)=Z(1)/2 830 FOR Y=2 TO C 840 LET U(Y)=Z(Y)/2+W(Y-1) 850 NEXT Y 860 GOTO 450 900 IF A$="Y" THEN COPY 904 PAUSE 200 905 CLS 910 PRINT "CATEGORY";TAB 14;"AMOUNT";TAB 23;"PERCENT" 915 PRINT 920 FOR Y=1 TO C 925 PRINT Y;". ";C$(Y);TAB 15;E(Y);TAB 22;S(Y)*100 935 NEXT Y 940 PRINT TAB 14;"----" 945 PRINT TAB 9;"TOTAL";TAB 15;T 947 IF A$="Y" THEN COPY 950 STOP ```