wildbill:
so,
1. draw ruler
You know the size of canvas, you know, how many division lines you need, so Its simple to calculate, where you must draw a lines.
width of canvas = 500
we need 100 division lines.
500/100 = 5 .. so, space between lines is 5 pixels.
for a = 0 to 100 step 5
line 0+a, y position, 0+a, y position+5
next a
is it clear ?
2. you must convert your values, because, 0,0 point is on left top of canvas

but we need it left down

again, simple mathematics.
0,0 is at 10,400
where is 10,10 ? at 20, 390, so ? x axis is ok, but Y axis must be recalculated. 400 - 10 = 390
3. and last thing, I am using multi array .. for example GRAPH(1000).something, so you can save value every 10 ms.
drawing graph is simple too, you can use for-next and draw every data in an array.
for me, the most hard part of this was programming with matices

yes, i have used matices for some calculations, horrible, terrible
PS: Real programmers aren't afraid of math!.
AMD 64x 3500+, 6GB RAM, GeForce 8800 GTS 320MB, HD 500GB, X-fi xtreme audio