Is this it, cant really tell if its correct using random data:

code:
$py = 0
While $frmMain.Visible
for $x = 0 to 199
$y=rnd(100)
$prgCPU.Value = $y
$y = 50-$y/2
$picCPU.Line($x-1,$py,$x,$y) ; inverse
sleep 0.1
$py = $y
next
$nul=Execute($frmMain.DoEvents)
Loop