Ary Borenszweig

Ary Borenszweig

Even more powerful Goolge Visualizations for Ruby on Rails

2 min
Aug 19 2010
coding, visualization
2 min
Aug 19 2010

Ok, now you can easily implement a Google Visualization API data source on rails. But... are you still using javascript to render them?

Well, you don't need to do that anymore. Now rgviz-rails supports a pretty simple and powerful way to do it. In your views templates you now have an rgviz function. You use it like this:


<%= rgviz :id => 'my_visualization',
:kind => 'BarChart',
:url => '/some_endpoint',
:query => 'select country_name, sum(age) group by country_name',
'options' => {:width => 640, :height => 480, :is3D => true}
%>

Not a single line of javascript code.

Yes, I know. You have a combo box and when the users changes its value you need to refresh the visualization, right? You can do it with what I call "magic names", hehe.

Read more about this. :-)