routine PLOT.DATA
''
'' AUTHOR: Steve Bailey
'' CREATED: 2-26-96
'' DESCRIPTION:
''  Plots data to all three data sets Y1, Y2, and Y3.
''

define X, Y, XMIN, YMIN, XMAX, YMAX, XINTERVAL as real variables

'' get the plot range of the chart
call GET.CHART.FIELD.R(CHART.PTR, .CHART.X.MIN) yielding XMIN
call GET.CHART.FIELD.R(CHART.PTR, .CHART.Y.MIN) yielding YMIN
call GET.CHART.FIELD.R(CHART.PTR, .CHART.X.MAX) yielding XMAX
call GET.CHART.FIELD.R(CHART.PTR, .CHART.Y.MAX) yielding YMAX
call GET.CHART.FIELD.R(CHART.PTR, .CHART.X.INTERVAL) yielding XINTERVAL

'' get rid of any existing data
call CLEAR.CHART.DATASET.R(CHART.PTR, 1)
call CLEAR.CHART.DATASET.R(CHART.PTR, 2)
call CLEAR.CHART.DATASET.R(CHART.PTR, 3)

let X = XMIN
while X <= XMAX do
    let Y = (YMIN + (YMAX - YMIN) * (X - XMIN) / (XMAX - XMIN))

      '' replot three cells. Y1, Y2 and Y3 are global display variables
    let TIME.V = X
    let Y1 = Y
    let Y2 = Y * 0.67
    let Y3 = Y * 0.33

    add XINTERVAL to X
loop
   
return
end
