graph functions

Jim Hurley jhurley at infostations.com
Wed Apr 7 08:56:15 EDT 2004


Sannyasin,

You can probably imagine what I will suggest: Turtle Graphics.

Just as a *rough* start, the code would be as simple as

on mouseUP
   put field 1 into dayOneData
   put field 2 into dayTwoData

   drawAxes

   startTurtle "dayOne"
   tell "dayOne"
   plot dayOnedata

   startTurtle "dayTwo"
   tell "dayTwo"
   plot dayTwoData

end mouseUP

on plot data
   repeat with i = 1 to the number of lines in data
     setxy line i of data
   end repeat
end plot

on drawAxes
   startTurtle "xAxis"
   tell "xAxis"
   repeat with i = 1 to 10
     setx 20*i
     label 20*i
   end repeat
   --Similarly for yAxis
end drawAxes

If Ken's or Klaus's stacks don't work for you, try the tools in

go url "http://home.infostations.net/jhurley/TellTurtles.rev"

The virtue of this variation on the traditional TG is that it allows 
you to create as many drawing objects as you need, each independent 
of the other. If you don't want to see the graph line being drawn, 
just lock the screen--that does speed things up considerably.

Jim



More information about the use-livecode mailing list