# Real-Time Graphing

**URL:** <https://www.ruby-forum.com/t/real-time-graphing/55380>\
**Category:** Ruby\
**Created:** [March 20, 2006, 4:59pm UTC](https://www.ruby-forum.com/t/real-time-graphing/55380 "2006-03-20T16:59:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pazuzu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pazuzu](https://www.ruby-forum.com/u/pazuzu)\
**Post date:** [March 20, 2006, 4:59pm UTC](https://www.ruby-forum.com/t/real-time-graphing/55380/1 "2006-03-20T16:59:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pazuzu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pazuzu](https://www.ruby-forum.com/u/pazuzu)\
**Post date:** [March 20, 2006, 5:58pm UTC](https://www.ruby-forum.com/t/real-time-graphing/55380/2 "2006-03-20T17:58:07Z")

</div>

On Tue, 21 Mar 2006, David I. wrote:

> graph.draw
> 
> end

what os? gnuplot can easily do this…

-a

---

<div class="post-metadata">

**Author:** ![pazuzu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pazuzu](https://www.ruby-forum.com/u/pazuzu)\
**Post date:** [March 20, 2006, 6:03pm UTC](https://www.ruby-forum.com/t/real-time-graphing/55380/3 "2006-03-20T18:03:10Z")

</div>

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:

> **[Gnuplot for Ruby - Browse Files at SourceForge.net](https://sourceforge.net/projects/rgnuplot/files/)**
>
> This project has been moved from this website to another. Please visit rubyforge.org for the latest.

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

-Dave

---

<div class="post-metadata">

**Author:** ![pazuzu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pazuzu](https://www.ruby-forum.com/u/pazuzu)\
**Post date:** [March 22, 2006, 12:25pm UTC](https://www.ruby-forum.com/t/real-time-graphing/55380/4 "2006-03-22T12:25:49Z")

</div>

> > > sender: “David I.” 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.graphviz.org/](http://www.graphviz.org/)  
the ruby module: [http://raa.ruby-lang.org/project/ruby-graphviz/](http://raa.ruby-lang.org/project/ruby-graphviz/)

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

I have used GraphViz however, and is a really cool piece of software 🙂  
check out the gallery: [https://graphviz.org/gallery/](http://www.graphviz.org/Gallery.php)

Good luck,  
Alex

---

<div class="post-metadata">

**Author:** ![pazuzu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@pazuzu](https://www.ruby-forum.com/u/pazuzu)\
**Post date:** [March 22, 2006, 2:21pm UTC](https://www.ruby-forum.com/t/real-time-graphing/55380/5 "2006-03-22T14:21:16Z")

</div>

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=Main\_Page](http://zedgraph.org/wiki/index.php?title=Main_Page) (only for Ruby  
instead of C#).

-Dave
