[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Real-Time Graphing

dishmael

3/20/2006 4:00:00 PM

Hello all .



I'm still kind of new to Ruby and trying to graph data in real-time but I
can't seem to find a suitable graphing engine. I've sniffed around using my
friend Google, but I didn't find anything concrete. Has anyone out there
done a GUI graph that updates in real-time (something simple like a line
chart)? Here's some pseudocode to help get my point across:



graph = SomeGraphEngine.new

graph.type = "line"



xvalues = Array.new

yvalyes = Array.new



for num in ( 0 .. 36 )

xvalues << Float( num * 10.0 + 50 )

yvalues << Float( Math.sin( num * Math.pi / 15.0 ) * 16.0 )

graph.coords( xvalues, yvalues )

graph.draw

end







-Dave

4 Answers

Ara.T.Howard

3/20/2006 4:58:00 PM

0

dishmael

3/20/2006 5:02:00 PM

0

Oh, sorry ... forgot to mention the OS is Windows XP Pro. I went to
Sourceforge to grab Gnuplot but there weren't any files listed other than
the manual:

http://sourceforge.net/project/showfiles.php?grou...

Do you have a link to the full code w/ examples?

-Dave


-----Original Message-----
From: ara.t.howard@noaa.gov [mailto:ara.t.howard@noaa.gov]
Sent: Monday, March 20, 2006 11:58 AM
To: ruby-talk ML
Subject: Re: Real-Time Graphing

On Tue, 21 Mar 2006, David Ishmael wrote:

> Hello all .
>
>
>
> I'm still kind of new to Ruby and trying to graph data in real-time but I
> can't seem to find a suitable graphing engine. I've sniffed around using
my
> friend Google, but I didn't find anything concrete. Has anyone out there
> done a GUI graph that updates in real-time (something simple like a line
> chart)? Here's some pseudocode to help get my point across:
>
>
>
> graph = SomeGraphEngine.new
>
> graph.type = "line"
>
>
>
> xvalues = Array.new
>
> yvalyes = Array.new
>
>
>
> for num in ( 0 .. 36 )
>
> xvalues << Float( num * 10.0 + 50 )
>
> yvalues << Float( Math.sin( num * Math.pi / 15.0 ) * 16.0 )
>
> graph.coords( xvalues, yvalues )
>
> graph.draw
>
> end

what os? gnuplot can easily do this...

-a
--
share your knowledge. it's a way to achieve immortality.
- h.h. the 14th dali lama



Alexandru E. Ungur

3/22/2006 11:26:00 AM

0

>>> sender: "David Ishmael" date: "Tue, Mar 21, 2006 at 12:59:32AM +0900" <<<EOQ
> Hello all .
Hi,

I think GraphViz is what you're looking for ;)
the tool: http://www.gra...
the ruby module: http://raa.ruby-lang.org/project/ruby...

<disclaimer>
never used the ruby module yet, as I am pretty new to Ruby (< 30 days).
</disclaimer>

I have used GraphViz however, and is a really cool piece of software :)
check out the gallery: http://www.gra...Gallery.php


Good luck,
Alex


dishmael

3/22/2006 1:21:00 PM

0

I had tried GraphViz in the past and couldn't get it to work. I installed
the Windows binary from GraphViz's site then installed the Ruby module.
Running the samples output (what appears to be) byte data which I redirect
to a file with the extension 'png'. When I try to view the output, nothing
renders it. Excluding that, I was hoping to find something more in-line
with http://zedgraph.org/wiki/index.php?title... (only for Ruby
instead of C#).

-Dave

-----Original Message-----
From: Alexandru E. Ungur [mailto:alexandru@globalterrasoft.ro]
Sent: Wednesday, March 22, 2006 6:26 AM
To: ruby-talk ML
Subject: Re: Real-Time Graphing

>>> sender: "David Ishmael" date: "Tue, Mar 21, 2006 at 12:59:32AM +0900"
<<<EOQ
> Hello all .
Hi,

I think GraphViz is what you're looking for ;)
the tool: http://www.gra...
the ruby module: http://raa.ruby-lang.org/project/ruby...

<disclaimer>
never used the ruby module yet, as I am pretty new to Ruby (< 30 days).
</disclaimer>

I have used GraphViz however, and is a really cool piece of software :)
check out the gallery: http://www.gra...Gallery.php


Good luck,
Alex