# Best way to implement animated chart in ruby

**URL:** <https://www.ruby-forum.com/t/best-way-to-implement-animated-chart-in-ruby/173149>\
**Category:** Ruby\
**Created:** [August 4, 2009, 3:26am UTC](https://www.ruby-forum.com/t/best-way-to-implement-animated-chart-in-ruby/173149 "2009-08-04T03:26:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![di3go](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9a28c/32.png) [@di3go](https://www.ruby-forum.com/u/di3go)\
**Post date:** [August 4, 2009, 3:26am UTC](https://www.ruby-forum.com/t/best-way-to-implement-animated-chart-in-ruby/173149/1 "2009-08-04T03:26:26Z")

</div>

I need to implement a animated chart in ruby, im using gtk.  
Anyone have a idea?  
The animation, needs to be smooth.

Cairo? RMagick(too slow to draw a chart 30 times a second)? any other  
plot gem? anyone know one?

Thanks alot!

---

<div class="post-metadata">

**Author:** ![di3go](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9a28c/32.png) [@di3go](https://www.ruby-forum.com/u/di3go)\
**Post date:** [August 4, 2009, 3:58am UTC](https://www.ruby-forum.com/t/best-way-to-implement-animated-chart-in-ruby/173149/2 "2009-08-04T03:58:37Z")

</div>

Diego B. wrote:

> I need to implement a animated chart in ruby, im using gtk.  
> Anyone have a idea?  
> The animation, needs to be smooth.
> 
> Cairo? RMagick(too slow to draw a chart 30 times a second)? any other  
> plot gem? anyone know one?

If you’re up for JRuby, there may be Swing components you could use.

Look at the Monkeybars lib for building GUI apps in JRuby.

–  
James B.

[www.jamesbritt.com](http://www.jamesbritt.com) - Playing with Better Toys  
[www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
[www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff  
[www.neurogami.com](http://www.neurogami.com) - Smart application development

---

<div class="post-metadata">

**Author:** ![di3go](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9a28c/32.png) [@di3go](https://www.ruby-forum.com/u/di3go)\
**Post date:** [August 4, 2009, 8:15am UTC](https://www.ruby-forum.com/t/best-way-to-implement-animated-chart-in-ruby/173149/3 "2009-08-04T08:15:33Z")

</div>

Diego B. wrote:

> I need to implement a animated chart in ruby, im using gtk.  
> Anyone have a idea?  
> The animation, needs to be smooth.
> 
> Cairo? RMagick(too slow to draw a chart 30 times a second)? any other  
> plot gem? anyone know one?
> 
> Thanks alot!

How about generating SVG (which is just xml) and displaying it using a  
browser. You could use just webrick to generate the pages.

---

<div class="post-metadata">

**Author:** ![di3go](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9a28c/32.png) [@di3go](https://www.ruby-forum.com/u/di3go)\
**Post date:** [August 4, 2009, 5:26pm UTC](https://www.ruby-forum.com/t/best-way-to-implement-animated-chart-in-ruby/173149/4 "2009-08-04T17:26:25Z")

</div>

On Mon, Aug 3, 2009 at 9:26 PM, Diego  
Bernardes[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I need to implement a animated chart in ruby, im using gtk.  
> Anyone have a idea?  
> The animation, needs to be smooth.
> 
> Cairo? RMagick(too slow to draw a chart 30 times a second)? any other  
> plot gem? anyone know one?

Have you looked at ruby-gnome2? You may be able to use the same  
underlying components that Gnome System Monitor does?

> **[The source of https://ruby-gnome.github.io/](https://ruby-gnome.github.io/)**
>
> The source of https://ruby-gnome.github.io/

---

<div class="post-metadata">

**Author:** ![di3go](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9a28c/32.png) [@di3go](https://www.ruby-forum.com/u/di3go)\
**Post date:** [August 5, 2009, 12:04am UTC](https://www.ruby-forum.com/t/best-way-to-implement-animated-chart-in-ruby/173149/5 "2009-08-05T00:04:33Z")

</div>

On Aug 4, 2009, at 7:15 AM, Diego B. wrote:

> This is why i need the animated charts.  
> Diego,  
> I’ve done a real-time updating chart that shows bandwidth usage and  
> other information from a satellite modem using bar graphs. In the app  
> there are 4 panels, and 8 bars per graphs. Each graph shows a  
> ‘peak’ (a line showing the highest the bar has ever been). Some bars  
> have different colors, and all of them have a slight beveled border  
> around them. On top of that the bars gradually step to their desired  
> values so they don’t just jump erratically.

I suppose I’m trying to paint a picture that shows a lot going on at  
once - The JRuby + Monkeybars route was worked pretty well for us and  
our client.

Logan B.  
removed\_email\_address@domain.invalid  
[http://www.logustus.com](http://www.logustus.com)

---

<div class="post-metadata">

**Author:** ![di3go](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9a28c/32.png) [@di3go](https://www.ruby-forum.com/u/di3go)\
**Post date:** [August 4, 2009, 4:15pm UTC](https://www.ruby-forum.com/t/best-way-to-implement-animated-chart-in-ruby/173149/6 "2009-08-04T16:15:28Z")

</div>

About web i can’t, it need to be a desktop application, because the  
integration with os.

The perfect example for what i need is gnome system monitor charts.

Jruby, maybe one alternative, need look a bit.

The application is to monitor some applications the company i work has  
in the intranet.

This is why i need the animated charts.

---

<div class="post-metadata">

**Author:** ![di3go](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a9a28c/32.png) [@di3go](https://www.ruby-forum.com/u/di3go)\
**Post date:** [August 5, 2009, 12:42am UTC](https://www.ruby-forum.com/t/best-way-to-implement-animated-chart-in-ruby/173149/7 "2009-08-05T00:42:01Z")

</div>

On Aug 3, 2009, at 18:26 , Diego B. wrote:

> I need to implement a animated chart in ruby, im using gtk.  
> Anyone have a idea?  
> The animation, needs to be smooth.
> 
> Cairo? RMagick(too slow to draw a chart 30 times a second)? any other  
> plot gem? anyone know one?

One of the ex-seattle.rb members did some REALLY pretty realtime full  
screen graphics stuff using cairo and ruby back in the day. It used  
continuations and all sorts of stuff that went over my head. What  
didn’t go over my head was the pretty and the slick.

That was back in 2002 or so… so I can’t find it… but rcairo should  
be able to meet your needs just fine.
