# FusionCharts empty value

**URL:** <https://www.ruby-forum.com/t/fusioncharts-empty-value/161139>\
**Category:** Rails\
**Created:** [February 23, 2009, 7:28pm UTC](https://www.ruby-forum.com/t/fusioncharts-empty-value/161139 "2009-02-23T19:28:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![remco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@remco](https://www.ruby-forum.com/u/remco)\
**Post date:** [February 23, 2009, 7:28pm UTC](https://www.ruby-forum.com/t/fusioncharts-empty-value/161139/1 "2009-02-23T19:28:12Z")

</div>

Hi

I have this method. When i run it the @arr\_data returns no value, so the  
graph remains empty. When i hard-code the value in the array, like this  
@arr\_data \<\< [‘test’, ‘1234’] it works. What i am doing wrong??

def stacked

```
  headers["content-type"]="text/html";
  @arr_data = []
  #Get data from factory masters table

  factory_masters = Fusioncharts::FactoryMaster.find(:all)
  factory_masters.each do |factory_master|
      total = 0.0
      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  
# Push the hash of values into the array  
@arr\_data \<\<  
{:factory\_name=\>factory\_name,:factory\_output=\>total}

```
  end
end
```
