Bar Chart in Rails

Hi Everyone, Can anyone tell me how to draw a bar chart in Rails? Is there any in-built method in Ruby on Rails (or) should i go for 3rd party plugins? I searched and came across this "open flash chart" - i don't know how to customize it according to my requirement.

PS: I have attached my requirement sample for you reference.

Thanks, Vasanth

Attachments: http://www.ruby-forum.com/attachment/3024/bar_chart.JPG

I have used Open Flash Charts. Try referring at pullmonkey.com . It has some good samples to get started.

Hi Jaikishan, The site you gave was good. But how to install Open Flash Chart plugin? where can i find the Gem file for that? I have to install the Gem file here in both Windows (development) and Linux (production) environment.

I tried this "ruby script/plugin install http://svn.pullmonkey.com/plugins/trunk/open_flash_chart/" but it didn't work out for me. I think it would be better if i can get that Gem file.

Can anyone tell me where to find that Gem file?

Thanks, Vasanth

Jaikishan Jalan wrote:

theoretically it could be done using the Rmagick 2D drawing methods, although i'm sure there's probably a better way

Vasanth,

You can download it from http://github.com/pullmonkey/open_flash_chart/tree/master. Just copy the downloaded folder under vendor/plugins and you will be ready to go.

I have been using FusionCharts. There is no gem, but I have a blog post on how to get started: http://forecasthorizon.blogspot.com/2008/07/fusion-charts-with-ruby-on-rails.html.

The post is on a line chart, but it is very easy to do any number of charts using FusionCharts. And you do not need to install RMagick, which I feel is a big bonus. Kaushik

Gruff is nice as well.

http://nubyonrails.com/pages/gruff

Jej

I recently used FusionCharts the free version. They have great documentation and it is pretty easy to connect them with a .rxml Once you get the hang of using them, they have many different types..

JavaScript charts for web and mobile apps. 95+ chart types, 1400+ maps and 20+ business dashboards with pre-built themes for any business use-case. Build fast, responsive and highly customizable data visualizations trusted by over 28,000 customers...

I highly recommend the Ziya gem. Fairly easy to use and you have a ton of control over all the aspects of the chart. There are a few examples on my website (http://www.assetcorrelation.com) but I'm hesitant to point you there because I'm severely deficient in anything relating to graphic design so my graphs don't look nearly as good as some of the other examples I've seen.

You can even try Charts Gallery  |  Image Charts  |  Google Developers but all depends on your application needs :wink: