D-19 Point to Point Curve

Developer(s): Warren Fricke
Date: 1990
Type: Program
Platform(s): TS 2068
Tags: Graphics

Turns twelve monthly sales figures into a point-to-point line graph. You type in the twelve dollar amounts; the program lists them with the highest and lowest month, dumps that screen to the TS2040 printer, then draws the curve against the months J to D, scaled to the highest month, and dumps it too, so the two screens print as one illustration.

The article also printed D-17, the matching vertical bar chart, which differs only in lines 205 to 240; parts of those lines are unreadable on the scan, so only D-19 is offered here.

Published in Sinc-Link September-October 1990 (Plotting Charts and Curves on the T/S 2040).

Image Gallery

Source Code

5 REM ** MODEL OF A POINT TO         POINT CURVE
10 REM ** "D-19", 3-2-88, WF
30 DRAW 0,175: DRAW 255,0: DRAW 0,-175
40 PRINT AT 1,4;"** SALES of DO-DADS **";AT 3,1;"MONTH","DOLLARS"
50 DIM a$(30): DIM s(12)
60 FOR n=1 TO 12
70 INPUT "Enter sales, month No. ";(n);"   ";s(n)
80 PRINT AT 4+n,3;n,s(n)
85 NEXT n
90 LET max=0
100 FOR n=1 TO 12
110 IF s(n)>max THEN LET max=s(n)
120 NEXT n
130 LET min=max
140 FOR n=1 TO 12
150 IF s(n)<min THEN LET min=s(n)
160 NEXT n
170 PRINT AT 18,1;"Highest Month = ";max;AT 19,1;"Lowest Month = ";min
180 PRINT AT 20,1;"Have PRINTER ready, and press";AT 21,1;" ENTER if data is OK.": INPUT c$
190 PRINT AT 20,1;a$;AT 21,1;a$: COPY : CLS
202 PRINT AT 6,1;"DOLLARS";AT 8,3;"of";AT 10,2;"SALES"
205 PRINT AT 20,1;"MONTH  J F M A M J J A S O N D"
207 PLOT 4,17: DRAW 246,0
208 PLOT 67,17+s(1)*158/max
210 FOR n=83 TO 243 STEP 16
220 LET y1=17+s((n-83)/16+1)*158/max
230 LET y2=17+s((n-67)/16+1)*158/max
240 DRAW 16,y2-y1: NEXT n
250 PLOT 0,175: DRAW 0,-175: DRAW 255,0: DRAW 0,175
260 COPY

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