winston / google_visualr

A Ruby Gem for the Google Visualization API. Write Ruby code. Generate Javascript. Display a Google Chart.

Home Page:http://googlevisualr.heroku.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make Charts more usable by not requiring data to be placed in controller

imasonaz opened this issue · comments

As the Gem stands, it is a bit cumbersome to get data from your Rails DB to be dynamically displayed by google_visular. It would be much easier if you could do something like: data_table = GoogleVisualr::DataTable.new(@users, 'Username', text, 'Posts', text, 'Join Date', Date)

You can practically bypass the need for this gem by simply using a <% @model.each do |model| %> which would better utilize both Rails and the MVC architecture.

I have considered that before, but I opted to make this library framework agnostic instead - in fact, plenty of issues were opened previously to ask if this is suitable for non-rails usage.

If you are looking for something easy out of the box, I would strongly recommend https://github.com/ankane/chartkick. Hope this explains!