> #<Client:0x4920884 @attributes={\"order_count\"=>\"4\", 
> \"sales_day\"=>\"2009-04-13\", \"sales_rep\"=>\"Michael\"}>,
> #<Client:0x4920848 @attributes={\"order_count\"=>\"2\", 
> \"sales_day\"=>\"2009-04-13\", \"sales_rep\"=>\"John\"}>,
> #<Client:0x492080c @attributes={\"order_count\"=>\"10\", 
> \"sales_day\"=>\"2009-04-13\", \"sales_rep\"=>\"Jane\"}>,
> #<Client:0x49204c4 @attributes={\"order_count\"=>\"1\", 
> \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"Michael\"}>,
> #<Client:0x4920488 @attributes={\"order_count\"=>\"9\", 
> \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"John\"}>,
> #<Client:0x4920438 @attributes={\"order_count\"=>\"7\", 
> \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"David\"}>,
> #<Client:0x49203e8 @attributes={\"order_count\"=>\"2\", 
> \"sales_day\"=>\"2009-04-14\", \"sales_rep\"=>\"Albert\"}>]"

I forgot to put what I wanted for output.  With the results above as a 
sample, I want:

sales_dates = [2009-04-13, 2009-04-14]

Then...

Michael, [4, 1]
John, [2, 9]
Jane, [10, 0]
David, [0, 7]
Albert, [0, 2]

or whatever it would take for me to iterate over an array/hash of 
sales_reps and call something like the following:

for rep in sales_reps
  sales_graph.add( :series, rep, [a, b] )
end

so that I would end up with:
  sales_graph.add( :series, "Michael", [4, 1] )
  sales_graph.add( :series, "John", [2, 9] )
  sales_graph.add( :series, "Jane", [10, 0] )
  sales_graph.add( :series, "David", [0, 7] )
  sales_graph.add( :series, "Albert", [0, 2] )

I hope this helps.  Again, any advice is greatly appreciated.

Regards,

Michael

-- 
Posted via http://www.ruby-forum.com/.