Hello David - Thanks very much for your response. I am not using CRT for my monitor. I have a 19 inches flat screen. Below is my code for ploting the graph.Message 1 of 3 , Oct 1, 2007View SourceHello David - Thanks very much for your response. I am not using CRT for my monitor. I have a 19 inches flat screen. Below is my code for ploting the graph. Please notice those program line in which I mention your name for observation.
'start of code
FI$ = "JOHN.bas"
PRINT "NAME OF FILE : ";FI$
INPUT " HOW MANY TOTAL DATA ";N ' <<< DATA N CAN BE FROM 1 TO 1280
INPUT " EXPAND GRAPH BY: 1 to 20 only ";G '<<< David - here is my graph EXPANSION
IF N < 320 THEN D = N ELSE D = INT(1230/G+10) ' <<< D = NUMBER DATA FOR GRAPH Base on Screen of 1280 pixie in width
DIM A(D+2),B(D+2) ,C(D+2),HS( D+2),LS(D+ 2),OA(D+2)
H9=0:L9=999999999: I=1:Y=5:W= 140:Z=.5: U=1.5:J=760: T=600
'NOTE: ON ABOVE J=760 < THIS PLOT THE GRAPH WITH A HEIGHT OF 0 TO 760 PIXIES
OPEN FI$ FOR INPUT AS #1 ' GET Daily or weekly SALES of Highest sale (HS), Lowest sale (LS), Overall Company sale (OA)
ON ERROR GOTO [BBA2]
IF EOF(#1)THEN [BBA2]
' sample data HS, LS, OA, HS, LS, OA ...
' sample data: 876.00, 450.00, 675.00,998.00, 490.00,718. 00 ......
FOR R=1 TO N
IF R > (N-D) THEN K = K+1:A(K)=HS: HS(K)=A(K) :B(K)= LS:LS(K) = B(K): C(K) = OA:OA(K)=C(K)
N = K
IF N < 300 THEN V = 5 ELSE V=N-INT(1280/ G)
FOR R = (V+9) TO N ' (V+9) is the first number to plot on graph
IF A(R) > H9 THEN H9 = A(R) ' < FINDING THE HIGHEST SALES
IF B(R) < L9 THEN L9 = B(R) ' < FINDING THE LOWEST SALES
SP = H9-L9 '< FINDING THE RANGE OF THE HIGH AND LOW SALES
FOR R = (V+9) TO N:A(R) = ABS(J - ( INT (((A(R) - L9) * J) / SP + Z) / INT(U))):NEXT R
UpperLeftX = 0 'Determine position of the graphic window on the screen
UpperLeftY = 0 'Determine position of the graphic window on the screen
WindowWidth = 1280
WindowHeight = 1024
open FI$ for graphics_fs_ nsb as #1 'open a graphics window full screen, w/no scroll bars
PRINT #1, "trapclose [Exit]"
I = 0
FOR R = (V + 9) TO N
PRINT #1, "DOWN"
print #1, "size 6" ' < Remember - take up 6-pixies on graph
print #1, "color red"
print #1, "line "; I; " "; A(R); " "; I; " "; A(R)
print #1, "size 1" ' < Remember - take up 1-pixies on graph
print #1, "color BLUE"
print #1, "line "; I; " "; A(R); " "; I-G; " "; A(R-1)
I = I + G ' <<< David, here is the SKIPING of X pixie ON GRAPH FOR PLOT
' end of code.
Moody friends. Drama queens. Your life? Nope! - their life, your story.
Play Sims Stories at Yahoo! Games.
[Non-text portions of this message have been removed]