# File app/controllers/fusioncharts/utf8_example_controller.rb, line 48 def pie_data_japanese headers["Content-Type"] = "text/xml; charset=utf-8" # xml content with charset=uttf-8 @factory_data = [] # Find all the factories factory_masters = Fusioncharts::JapaneseFactoryMaster.find(:all) # For each factory, find the factory output details. factory_masters.each do |factory_master| factory_name = factory_master.name total = 0.0 factory_master.factory_output_quantities.each do |factory_output| # Total the output quantity for a particular factory total = total + factory_output.quantity end # Append the array of factory name and total output quantity to the existing array @factory_data @factory_data<<[factory_name,total] end end