Gimzo
2006-Jun-06 05:43 UTC
[Rails] Getting result from sql and displaying it on Gruff pie chart
I have the following as my sql query:
@total = @report.report_items.find_by_sql "SELECT SUM(amount) FROM
report_items WHERE report_item_selected = ''y'' AND available =
''n'' AND
user_id = 1"
I am trying to add the value of SUM(amount) to a Gruff pie chart and it
does not seem to be working. I have the following:
g.data("Items", @total)
Does anyone know how to do this?
Thanks for your help
--
Posted via http://www.ruby-forum.com/.