    # File app/controllers/fusioncharts/db_drilldown_controller.rb, line 12
      def default
         headers["content-type"]="text/html";
        str_data_url = '';
        #Get data from factory masters table

        factory_masters = Fusioncharts::FactoryMaster.find(:all)

        @factory_data = []
        #Loop through each record
          factory_masters.each do |factory_master|
              total = 0.0
              #Get factoryid and factoryname
              factory_id = factory_master.id
              factory_name = factory_master.name
              factory_master.factory_output_quantities.each do |factory_output|
                      total = total + factory_output.quantity
              end
              # Escape the URL
              str_data_url = CGI.escape("/Fusioncharts/db_drilldown/detailed?FactoryId="+factory_id.to_s)
              # Put the hash of values in the array
              @factory_data<<{:str_data_url=>str_data_url, :factory_name=>factory_name, :factory_output=>total}
          end
      end