jeremyolliver / gvis

Rails plugin for easy embedding charts with Google Visualization API
http://github.com/jeremyolliver/gvis
MIT License
49 stars 22 forks source link

Going from a hash with key-value pair to a trending line or bar graph #7

Closed timfong888 closed 14 years ago

timfong888 commented 14 years ago

Hi, hoping you can help: it looks like it is there. This is the ordered hash I can generate:

=> #<OrderedHash {"2010-10-23"=>2, "2010-09-22"=>3, "2010-09-11"=>1, "2010-08-27"=>1, "2010-10-15"=> 1, "2010-09-15"=>1, "2010-08-08"=>2, "2010-10-17"=>14, "2010-10-06"=>2, "2010-09-28"=>1, "2010-10-19 "=>1, "2010-09-20"=>1}>

How can I make this a bar graph, where x is the key (date) and the y is the value?

jeremyolliver commented 14 years ago

Can I assume, this is also you posting to stackoverflow? I see you've accepted an answer there, so I'm going to close this as it isn't an issue with this plugin. If you want help manipulating ruby arrays/hashes, stackoverflow is definitely a good place, or send me a message.

timfong888 commented 14 years ago

Hi, readded the question -- it does seem like a gem because the example doesn't show how to pass an array or hash...is the only way to have a point-by-point?