I have a model, ContactEmail that has a date_sent attribute and an email_id, referencing another model Email.
I would like to create a bar graph which shows on the x-axis dates and on the y-axis the number of ContactEmails that were sent on a specific date.
I would like to also do the same, filtered for ContactEmails where email_id equals a specific value.
My end-goal is to have some kind of a bar graph -- I am still researching how to do that, but regardless, it seems like I would need some kind of a time-series array, which I suppose would have date as one element, and the count for the other.
How do I do this?
The graphing solution I am looking at is called Seer:
I am using the statistics gem, which is outputting a hash that looks like this:
=> #<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}>
1) How can I put that in an order? 2) Does Seer recognize null date values?