--- title: "Pie Chart: A Refinement" id: 76561 type: "computer_media" slug: "pie-chart-a-refinement" url: "http://localhost/computer_media/pie-chart-a-refinement/" markdown_url: "http://localhost/computer_media/pie-chart-a-refinement.md" published_at: "2026-11-11T08:02:30+00:00" modified_at: "2026-11-11T08:02:30+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/11/pie-chart-a-refinement-1.png" excerpt: "A rewrite of the ZX81 pie chart program: enter up to 18 values and see them drawn as a pie with a table of 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: "John Pazmino" slug: "john-pazmino" taxonomy: "indiv" url: "http://localhost/indiv/john-pazmino/" genre: - name: "Graphics" slug: "graphics" taxonomy: "genre" url: "http://localhost/type/graphics/" media_type: "Program" programmers: - name: "John Pazmino" slug: "john-pazmino" taxonomy: "indiv" url: "http://localhost/indiv/john-pazmino/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Pie%20Chart%20-%20A%20Refinement%20%281983%29%28Pazmino%2C%20John%29%28TS1000%29%28US%29%28Program%29.zip" mediadate: "1983" images: - url: "http://localhost/wp-content/uploads/2026/11/pie-chart-a-refinement-1.png" article_media: - id: 19585 title: "Pie Chart: A Refinement" type: "article" url: "http://localhost/article/pie-chart-a-refinement/" related_content: - id: 19357 title: "Pie Chart Graph and Display" type: "article" url: "http://localhost/article/pie-chart-graph-and-display/" media_type_tags: "Graphics" license: false --- # Pie Chart: A Refinement RUN shows a title, then asks INPUT NUM OF SEG: and a value for each segment. The program draws the circle in FAST mode, then the radii in SLOW mode, and prints a table of each segment’s value and its share in percent, with the total. It needs 16K. The article suggests COPY to print the chart. GOTO 970 saves the program so that it starts itself when loaded. It is a reworking of Ron Oblander’s Pie Chart Graph and Display from November 1982. Published in Syntax November 1983 ([Pie Chart: A Refinement](https://timexsinclair.com/article/pie-chart-a-refinement/)). ## Source Code ``` 1 LET N0=0 2 PRINT AT 10,N0;"PIECHART FOR UP TO 18 SEGMENTS" 3 PAUSE 200 4 CLS 6 LET T=N0 8 LET R=18 10 LET Q=45 12 LET W=N0 15 PRINT " INPUT NUM OF SEG:" 20 INPUT C 22 DIM E(C) 26 FOR I=1 TO C 41 PRINT " THEN INPUT VAL FOR SEG ";I;":" 42 INPUT E(I) 45 CLS 57 LET T=T+E(I) 59 NEXT I 100 FAST 105 PLOT Q,R 120 FOR P=N0 TO 6.3 STEP 0.056 140 PLOT Q+SIN P*R,R+COS P*R 200 NEXT P 205 PRINT AT N0,N0;"SEG";TAB 4;"VAL ";TAB 10;"O/O" 217 SLOW 220 FOR I=1 TO C 230 LET Z=E(I)*2*PI/T 405 LET W=Z+W 410 LET M=SIN W 420 LET N=COS W 560 FOR J=N0 TO R 570 PLOT Q+M*J,R+N*J 580 NEXT J 920 PRINT AT I,N0;I;TAB 4;E(I);TAB 10;INT (E(I)*100/T+0.5) 930 NEXT I 960 PRINT TAB 4;"----";TAB N0;"SUM ";T 965 STOP 970 SAVE "PIECHART" 980 RUN ```